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