javascript - jquery.ui sortable issue -


I've created a nested list with drag / drop functionality. My point is that I want the victims of each nest to For example:

 -first_level -first_level -second_level -second_level -first_level 

"first level" should not be able to go into "second level" and its Adverse. I thought I could do it with the option of prevention, but there is no dice there. It works with the first level to maintain the second level, but not on the other side.

Here's my example JS and list:

  $ ("# sort_list"). Serial ({prevention: '#sort_list', axis: 'Y', back Return: Correct, Item: 'Li', Opacity: 0.8}); $ (". Sub_list"). Sorted ({prevention: 'parent', axis: 'y', return: true, item: 'li', opacity: 0.8,}); $ ("# Sort_list") disableSelection () .; & Lt; Ul id = "sort_list" & gt; & Lt; Li & gt; A & lt; / Li & gt; & Lt; Li & gt; Two & lt; Ul class = "sub_list" & gt; & Lt; Li & gt; Sub A & lt; / Li & gt; & Lt; Li & gt; Sub-two & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; Three & lt; / Li & gt; & Lt; Li & gt; Four & lt; / Li & gt; & Lt; / Ul & gt;  

Any ideas? Thanks guys!

Try to give prevention options like a complex selector:

  $ ("# Sort_list"). Sorted ({prevention: '#sort_list: no (.sub_list)', axis: 'y', return: right, item: 'li', opacity: 0.8});  

If you are using jQuery 1.3 +:

(to)

then it should < P> As jQuery 1.3: not () also supports selectors by comma and complex selectors, for example: no (div a) and: not (div, a).

The Jquery layoffs manual says that the option:

prevents dragging within the specified element's range - a 'dome element', ' Parent ',' document ',' window 'or a jQuery selector.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -