var product;
$.ajax({
url: '请求数据地址',
type: "post",
async: false,
dataType: "json",
success: function (result) {
product = result;
}
});
$('#txtSalesMan').combogrid({
methord: 'post',
idField: 'UserName',
textField: 'TrueName',
panelHeight: '200',
columns: [
[
{ field: 'UserName', title: '用户名', width: 100 },
{ field: 'TrueName', title: '真实名称', width: 100 }
]
],
onChange: function (q) {
doSearch(q, product, ['UserName', 'TrueName'], $(this));
},
onShowPanel: function () {
$(this).combogrid('grid').datagrid('loadData', product);
}
});