This. Setdict = function (obj, dictype, multiple, Ischeckbox, callback, change) {
Obj.combogrid ({
PANELWIDTH:250,
IDfield: ' Code ',
TextField: ' Name ',
URL: '/common/entityjsonlist.ashx?_method=dict&dicttype= ' + dictype + "&tmp=" + math.random () + ' & Querytextfild=name ',
Method: ' Get ',
delay:1000,
Columns: [[
{field: ' Name ', title: ' Names ', width:100},
{field: ' Code ', title: ' Code ', width:100}
]],
Striped:true,
Editable:true,
Collapsible:false,//Can be folded
Fit:true,//Auto Size
Keyhandler: {
Up:function () {//"up key" to defer processing
Access to selected BOC
var selected = Obj.combogrid (' grid '). DataGrid (' getselected ');
if (selected) {
Get the rowindex of the selected row
var index = obj.combogrid (' grid '). DataGrid (' Getrowindex ', selected);
Move up to the first action stop
if (Index > 0) {
Obj.combogrid (' Grid '). DataGrid (' SelectRow ', index-1);
}
} else {
var rows = Obj.combogrid (' grid '). DataGrid (' GetRows ');
Obj.combogrid (' Grid '). DataGrid (' SelectRow ', rows.length-1);
}
},
Down:function () {//"down arrow" to defer processing
Access to selected BOC
var selected = Obj.combogrid (' grid '). DataGrid (' getselected ');
if (selected) {
Get the rowindex of the selected row
var index = obj.combogrid (' grid '). DataGrid (' Getrowindex ', selected);
Move down to the last line of the page
if (Index < Obj.combogrid (' grid '). DataGrid (' GetData '). Rows.length-1) {
Obj.combogrid (' Grid '). DataGrid (' SelectRow ', index + 1);
}
} else {
Obj.combogrid (' Grid '). DataGrid (' SelectRow ', 0);
}
},
Enter:function () {//"enter" to defer processing
Obj.combogrid (' Hidepanel ');
},
Query:function (keyword) {//"Dynamic Search" processing
Set query parameters
var queryparams = Obj.combogrid ("Grid"). DataGrid (' Options '). Queryparams;
Queryparams.keyword = keyword;
Obj.combogrid ("Grid"). DataGrid (' Options '). Queryparams = Queryparams;
Reload
Obj.combogrid ("Grid"). DataGrid ("Reload");
Obj.combogrid ("setValue", keyword);
}
},
Mode: ' Remote ',
Fitcolumns:true,
Multiple:multiple,
Checkbox:ischeckbox,
Onloadsuccess:function () {
if (callback) {
Callback ();
}
},
Onchange:function (value, index, data) {
if (change) {
Change (value, index, data);
}
}
});
}
Combogrid Change Check Multiple