私がこれを使用する場合:
loadComplete: rowCount()
動いていない。
直接電話してもうまくいかない理由が知りたいです。
コードスニペット:
function rowCount() {
var recCount = $("#fbDetailTable").jqGrid('getGridParam', 'records');
if (recCount == 0) {
displayMessage("Freight bill not found");
} else {
displayMessage("Freight bill found");
}
}
function getFreightBill() {
var frtBill = document.getElementById("freightBill").value;
if (isNaN(frtBill)) {
displayMessage("Freight bill contain digits alone");
} else {
var intTemplate = {
sorttype: "integer",
formatter: "text",
align: "center"
};
var dateTemplate = {
sorttype: "date",
formatter: "date",
align: "center"
};
$("#fbDetailTable").jqGrid('GridUnload');
$("#fbDetailTable").jqGrid({
url: "/BSNReportBatch/rs/FBService/getFB?fB=" + frtBill,
datatype: "json",
colNames: ["Store Number", "Order Number", "SKU number",
"Shipped Quantity", "Order Created Date"],
colModel: [{
name: "strNbr",
template: intTemplate
}, {
name: "orderNbr",
template: intTemplate
}, {
name: "skuNbr",
template: intTemplate
}, {
name: "shpdQty",
template: intTemplate
}, {
name: "ordCrtDt",
template: dateTemplate
}],
cmTemplate: {
width: 180
},
jsonReader: {
repeatitems: false,
id: "strNbr",
root: function (obj) {
return obj;
}
},
pager: "#fbPager",
rowNum: 50,
rowList: [50, 100, 200],
sortName: "strNbr",
sortOrder: "desc",
gridview: true,
autoencode: true,
height: "auto",
viewrecords: true,
loadonce: true,
caption: "Order Details",
loadComplete: function () {
rowCount();
}
});
}
}