读书人

easyui 依据名字选中行

发布时间: 2013-12-26 00:35:35 作者: rapoo

easyui 根据名字选中行

$('#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);

}

})

}

}

?

});

读书人网 >Web前端

热点推荐