我得到 TypeError: e is null ...numberInput.attr("disabled",true)}else{n.host.removeClass(c.toThemeProperty("jqx... 当我尝试从 jqwidget grid.pls 获取聚合值时)告诉我我犯了什么错误,我怀疑这个$("#tblInvoices").jqxGrid('getcolumnaggregateddata', 'gainPrice', ['min', 'max']);
var source ={
datatype: "json",
url: url,
data: {invoice_id: $("#id").val()},
datafields: [
{ name: 'roundNo' },
{ name: 'engineNo'},
{ name: 'chasiNo'},
{ name: 'model_id'},
{ name: 'gainPrice'},
{ name: 'selingPrice'},
{ name: 'remark'}
],
addrow: function (rowid, rowdata, position, commit) {
// synchronize with the server - send insert command
var id=$("#id").val();
var data = "insert=true&invoice_id="+id+"&"+ $.param(rowdata);
$.ajax({
dataType: 'json',
url: url,
data: data,
cache: false,
success: function (data, status, xhr) {
// insert command is executed.
commit(true);
},
error: function (jqXHR, textStatus, errorThrown) {
commit(false);
}
});
},//end add row
deleterow: function (rowid, commit) {
// synchronize with the server - send delete command
var data = "delete=true&" + $.param({ roundNo: rowid });
$.ajax({
dataType: 'json',
url: url,
cache: false,
data: data,
success: function (data, status, xhr) {
// delete command is executed.
commit(true);
},
error: function (jqXHR, textStatus, errorThrown) {
commit(false);
}
});
},
updaterow: function (rowid, rowdata, commit) {
// synchronize with the server - send update command
var id=$("#id").val();
var data = "update=true&invoice_id="+id+"&"+ $.param(rowdata);
$.ajax({
dataType: 'json',
url: url,
cache: false,
data: data,
success: function (data, status, xhr) {
// update command is executed.
commit(true);
},
error: function (jqXHR, textStatus, errorThrown) {
commit(false);
}
});
}
};
var dataAdapter = new $.jqx.dataAdapter(source);
//..............................................................
$( "#tblInvoices").jqxGrid({
theme: 'darkblue',
source: dataAdapter,
columnsresize: true,
showaggregates: true,
showstatusbar: true,
statusbarheight: 50,
selectionmode: 'singlecell',
editable: true,
columns: [
{ datafield: 'roundNo', text: 'R/N', type: 'text', width: 60 },
{ datafield: 'engineNo', text: 'Engine No', type: 'text', width: 100 },
{ datafield: 'chasiNo', text: 'Chasi No', type: 'text', width: 100 },
{ datafield: 'model_id', text: 'Model No', type: 'text', width: 100 },
{ datafield: 'gainPrice', text: 'Gain Price', cellsformat: 'n2', width: 60 ,aggregates: ['min', 'max']},
{ datafield: 'selingPrice', text: 'Seling Price', type: 'text', width: 60,aggregates: [{ 'Total':
function (aggregatedValue, currentValue) {
if (currentValue) {
return aggregatedValue + 1;
}
return aggregatedValue;
}
}] },
{ datafield: 'remark', text: 'Remark', type: 'text', width: 120 }
]
});
//end grid loadi..
var ta = $("#tblInvoices").jqxGrid('getcolumnaggregateddata', 'gainPrice', ['min', 'max']);
alert(ta.min);
});