Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Nested Sortable with handlers

$
0
0

Okay an answer to my own question though I think it is not a great solution. Use a whitespace selector for the ignore pattern in the parent list... If you have a better answer please let me know.

<ulid="sortable">
    <liclass="sort">
      <div>
        <spanclass="hand"></span>
        <ulclass="nested">
          <liclass="not-sub-sort">
            <div><spanclass="nestedhand"></span>ItemB1<inputtype="text"/></div>
          </li>
          <liclass="sub-sort">
            <div><spanclass="nestedhand"></span>ItemB2<inputtype="text"/></div>
          </li>
          <liclass="sub-sort">
            <div><spanclass="nestedhand"></span>ItemB3<inputtype="text"/></div>
          </li>
        </ul>
      </div>
    </li>
    <liclass="sort"><div><spanclass="hand"></span>ItemA2 <inputtype="text"/></div></li>
    <liclass="sort"><div><spanclass="hand"></span>ItemA3 <inputtype="text"/></div></li>
    <liclass="not-sort">
       <div>
        <spanclass="hand"></span>
        <ulclass="nested">
          <liclass="not-sub-sort">
            <div><spanclass="nestedhand"></span>ItemB1<inputtype="text"/></div>
          </li>
          <liclass="sub-sort">
            <div><spanclass="nestedhand"></span>ItemB2<inputtype="text"/></div>
          </li>
          <liclass="sub-sort">
            <div><spanclass="nestedhand"></span>ItemB3<inputtype="text"/></div>
          </li>
        </ul>
      </div>
    </li>
</ul>
 
<script>
    $("#sortable").kendoSortable({
        handler: '.hand',
        ignore: ".nested *",
        filter: ">li.sort"
    });
    $(".nested").kendoSortable({
        handler: '.nestedhand',
        ignore: 'input',
        filter:'>li.sub-sort'
    });
</script>
   
<style>
  .hand, .nestedhand {
    background-color: #f00;
    width: 20px;
    height: 20px;
    display: inline-block;
  }
</style>

Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>