Kendo ui Sortable发送对象功能

时间:2016-11-21 15:46:26

标签: angularjs sorting kendo-ui

如果我想在kendo ui中找到移动的对象,我可以得到的只是函数中的简单(e)事件所有属性...但是如何获取带有id,name,title的原始对象。 ..

<ul id="playlist" class="playlist" kendo-sortable k-placeholder="placeholder" k-connect-with="'#playlist2,#hey'"  k-hint="hint" k-change="matt2" k-options="sortableOptions">
<li ng-repeat="obj in listItems2">
    <div class="item"> {{obj.title}} </div>
 </li>
</ul>

$scope.sortableOptions = {        
    end: function(e) {
      var test = {
        name: e.item[0].innerText,
        title: e.item[0].innerText
      };                
    var index = e.newIndex;
    if (index == -1)
    $scope.listItems.push(test);  
      console.log(e);
    }        
  }

Here is the examle on code pen

0 个答案:

没有答案