开发者

Jquery Sortable

Hi is there any means of adding a new box as a part of sortable at click of button on this fiddle using jquery-ui

For eg there are 12 boxes on click of button i should be able to add another box that is sortable and the id of it should be unique, so as even if one of box is deleted and added we have uni开发者_如何转开发que ids for saving to database.


http://jsfiddle.net/Wmjsr/4/

here you go.

You can actually create a function to create the boxes on the fly, and reuse that in your add-button click function. Basically I just cloned one of the boxes and appended them to the ul. What you can do is after cloning(or if you followed my advice in creating the boxes on the fly) fix the id and value of the box. You'll probably need a boxCounter global variable to keep track of the ids you are generating and deleting

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜