2016-06-14 85 views
0

我想在點擊按鈕後從行列表中刪除行。我在事件「click:remove」中綁定函數。首先,我選擇一行,然後嘗試從DataSource中刪除對象。這一點是不正確的。從移動列表中刪除行kendo

remove: function() { 
        var that = this; 
        if (this.isGridSelected) { 
         var arr = []; 
         arr = this.selectedRow.toJSON();//this line show selected row 

         this.roleDataSourcePrzypisane.remove(this.arr);//I think this row is wrong ...Remove no work 
         console.log(this.roleDataSourcePrzypisane); 


         this.set("roleDataSourcePrzypisane", this.roleDataSourcePrzypisane); 

        } else { 
         iwInfo('Please choose row', 'warning'); 
        } 


       } 

回答

0
function removeRow(e) { 
    var treelistCurrentInstance = $("#treelist").data("kendoTreeList"); 
    var currentRow = $(e).closest('tr'); 
    treelistCurrentInstance.removeRow(currentRow); 
} 

我已經試過類似的東西,我對按鈕的情況下考慮當前行的參考和使用劍道樹形列表的removeRow方法。