首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

easyui 依据名字选中行

2013-12-26 
easyui根据名字选中行$(#upScope).click(function() {var checkedItems $(#updateScope).datagrid(

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);

}

})

}

}

?

});

热点排行