开发者

jquery cancel sortable on specific handle

I have a list to which I have applied droppable and sortable among each other. Each list item contains a div box which gets open when click on "edit" link on the list item. There are few other list items on that div box. I want to do sorting of the div's list item among each other. But the problem I am facing is that when I am trying to sort list items the parent list item's sorting is invoked.

My research found that using "cancel" parameter helps to disable dragging. Syntax below:

$( ".selector" ).draggable({ cancel: '#box' }); 

But that works perfectly for draggable. I want to achieve similar but I do not find any such parameter in case of droppable or sortable.

The visual description of the problem is linked here:

jquery cancel sortable on specific handle

Above I have tried to describe in a very simple manner. Actually, in my project there are many rows, panels. fields, items structure which are sortable, draggable, droppable. Very confusing though.

while I was working on the fiddle I found it working as per my need. I have linked the url here - http://jsfiddle.net/PkRJu/9/

Looks like something else is wrong. I am working on it. Let me know if any one can suggest what I 开发者_C百科am doing wrong.


To disable sortable after you have created it you could use:

$( ".selector" ).sortable( "option", "disabled", true );

For the droppable

$( ".selector" ).droppable( "option", "disabled", true );

If you still have problem try to post your code here and on jsfiddle.net so that we can help

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜