简体   繁体   中英

Creating a dynamic table with movable rows

I would like to create a table of items like this invoice in Ruby on Rails, any hints on where I can start? I am fairly new to JavaScript. Also is there a gem that can do the job?

I cant give a full example as your request is fairly generic. There are about 1000 possibilities to do this: use raw javascript, use jQuery, use jQuery Datatables, use Js + AngularJS etc. The only common thing is that a JSON backend on the server side is also needed, so your javascript can communicate with your server and save the data.

However, I would recommend the jQuery DataTables plugin. A starting point would be the "adding rows example" . Also, check out the railscasts databable tutorial for details on JSON backend.

I would recommend using the Nested Form gem. http://railscasts.com/episodes/196-nested-model-form-part-1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM