This is a sudden error, and it has been no problem before, and now I can’t find the error.
I intercepted some code snippets:
var customerSource = {
datatype: “json”,
datafields: [
{ name: ‘customer_name’, type: ‘string’ },
{ name: ‘customer_id’, type: ‘string’ }
],
url:’../../customer/getAllCustomer.do’,
async:false,
cache: false,
id:’customer_id’
};
var customerAdapter = new $.jqx.dataAdapter(customerSource, { autoBind: true});
console.log(customerAdapter);
This is the customer resource obtained.
var source = {
filter: function() {
$(“#baseDataGrid”).jqxGrid(‘updatebounddata’, ‘filter’); //过滤
},
sort: function() {
$(“#baseDataGrid”).jqxGrid(‘updatebounddata’,’sort’);
},
sortcolumn: ‘statistics_id’,
sortdirection: ‘desc’ ,
dataType: “json”,
dataFields:
[
{ name: ‘customer_id’, type: ‘string’ },
{
name: ‘customer_name’, type: ‘string’,value: ‘customer_id’,
values: { source: customerAdapter.records, value: ‘customer_id’, name: ‘customer_name’ }
},
{ name: ‘order_amount’, type: ‘string’}
],
cache: false,
async:false,
url: ‘../../contract/showContractStatisticsList.do’,
data:{‘jsonParams’:JSON.stringify(jsonParams)},
root: ‘rows’,
id: ‘statistics_id’,
beforeprocessing: function (data) {
source.totalrecords = data.total;
},
updaterow: function (rowid, newdata, commit) {
method.updateContractInfo(newdata);
commit(true);
}
};
This is the code that initializes the source