`

easyui 根据名字选中行

    博客分类:
  • web
 
阅读更多

$('#upScope').click(function() {

var checkedItems = $('#updateScope').datagrid('getChecked');

var names = [];

$.each(checkedItems, function(index, item) {

names.push(item.name);

});

document.getElementById("scope").value = names;

});

var scope = document.getElementById("scope").value;

var rows = $('#updateScope').datagrid('getRows');

var arrayObj = new Array();

arrayObj=scope.split(",");

for(var m=0;m<rows.length;m++){

for (i=0;i<arrayObj.length;i++ )    

   {   

if(rows[m].name==arrayObj[i]){

$('#updateScope').datagrid('selectRow',m);

}

      

   }

}

 

onLoadSuccess:function(data){

if(data){

$.each(data.rows,function(index,item){

if(item.checked){

$('#updateScope').datagrid('checkRow',index);

}

})

}

}

 

});

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics