0

I want to create a page containing more with nested lists.

Using jQueryUI selectable(), I want to select some container and then some list item.

Selecting an item seems not working correctly in my case.

  1. Containing div gets ui-selecting and ui-selected at the same time.
  2. Click on list item sometimes works, but not all the time
  3. Disabling selection on mainview it works correctly again.

Is this behavior problem of jQuryUI or is it my problem?

Thanks!

    <script src="Scripts/jquery-1.7.1.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui-1.8.18.custom.js" type="text/javascript"></script>
    <style>

    #selectable .ui-selecting { background: #FECA40; }
    #selectable .ui-selected { background: #F39814; color: white; }
    #selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
    #selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
    </style>
    <script>
        $(function ()
        {
            $("#mainview").selectable({ filter: '.card' });
            $("#selectable").selectable();
        });

    </script>
</head>
<body>
    <div id='mainview'>
        <div id='container1' style="width: 200px; height: 250px; background-color: yellow;top=100; left=100;">
            <ol id="selectable">
                <li>Item 1</li>
                <li>Item 2</li>
            </ol>
        </div>         
    </div>
Dusan Kocurek
  • 445
  • 3
  • 8
  • 22
  • Have you seen [this question](http://stackoverflow.com/questions/6207406/jquery-ui-nested-selectable-issue)? – bfavaretto May 10 '12 at 21:34
  • Thanks for such quick response, I'll check described solution. – Dusan Kocurek May 10 '12 at 21:37
  • 2
    bfaveretto, I tried proposed solution and partially it works. But there is a difference of the way how to select item by mouse if container is selectable or not. In case container IS selectable - you have to click on item and do small drag, just few pixels. In case container IS NOT selectable - everything works perfectly. There is no distance specified, so my expectation is that it should works the same way. I even tried to debug jQuery, but did not find solution. – Dusan Kocurek May 11 '12 at 21:13

0 Answers0