In general, the undefine error occurs in the browser using the jgrid table. I am very suspicious. I will summarize the two solutions below.
1. If your version is older than 4.0, you can install the instructions on WebKit to install your JS file, that is to say, You need to include <SCRIPT src = "JS/i18n/grid. locale-en.js "type =" text/JScript "> </SCRIPT> This JS file and your order needs to be fixed according:
<SCRIPT src = "JS/jquery-1.5.2.min.js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT src = "JS/i18n/grid. locale-en.js" type = "text/JScript"> </SCRIPT>
<SCRIPT src = "JS/jquery. jqgrid. Min. js" type = "text/JavaScript"> </SCRIPT>
In this order, undefine will not appear in Firefox, and this error will not appear in chrome.
2. If your version is newer, you need to install your JS file following my instructions so that undefine does not appear.
<SCRIPT src = "JS/jquery-1.5.2.min.js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT src = "JS/grid. loader. js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT src = "JS/jquery. fmatter. js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT src = "JS/i18n/grid. locale-en.js" type = "text/JScript"> </SCRIPT>
<SCRIPT src = "JS/jquery. jqgrid. Min. js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT src = "JS/jquery-ui-1.8.2.custom.min.js" type = "text/JavaScript"> </SCRIPT>
Test code:
<Table id = "list47"> </table> <Div id = "plist47"> </div>
<SCRIPT type = "text/JavaScript">
VaR mydata = [
{ID: "1", invdate: "2010-05-24", name: "test", note: "NOTE", tax: "10.00", total: "2111.00 "},
{ID: "2", invdate: "2010-05-25", name: "Test2", note: "note2", tax: "20.00", total: "320.00 "},
{ID: "3", invdate: "", name: "test3", note: "note3", tax: "30.00", total: "430.00 "},
{ID: "4", invdate: "2007-10-04", name: "test", note: "NOTE", tax: "10.00", total: "210.00 "},
{ID: "5", invdate: "2007-10-05", name: "Test2", note: "note2", tax: "20.00", total: "320.00 "},
{ID: "6", invdate: "2007-09-06", name: "test3", note: "note3", tax: "30.00", total: "430.00 "},
{ID: "7", invdate: "2007-10-04", name: "test", note: "NOTE", tax: "10.00", total: "210.00 "},
{ID: "8", invdate: "2007-10-03", name: "Test2", note: "note2", amount: "300.00", tax: "21.00", total: & quot; 320.00 & quot "},
{ID: "9", invdate: "", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: & quot; 430.00 & quot "},
{ID: "11", invdate: "2007-10-01", name: "test", note: "NOTE", amount: "200.00", tax: "10.00", total: & quot; 210.00 & quot "},
{ID: "12", invdate: "2007-10-02", name: "Test2", note: "note2", amount: "300.00", tax: "20.00", total: & quot; 320.00 & quot "},
{ID: "13", invdate: "", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: & quot; 430.00 & quot "},
{ID: "14", invdate: "2007-10-04", name: "test", note: "NOTE", amount: "200.00", tax: "10.00", total: & quot; 210.00 & quot "},
{ID: "15", invdate: "2007-10-05", name: "Test2", note: "note2", amount: "300.00", tax: "20.00", total: & quot; 320.00 & quot "},
{ID: "16", invdate: "2007-09-06", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: & quot; 430.00 & quot "},
{ID: "17", invdate: "2007-10-04", name: "test", note: "NOTE", amount: "200.00", tax: "10.00", total: & quot; 210.00 & quot "},
{ID: "18", invdate: "2007-10-03", name: "Test2", note: "note2", amount: "300.00", tax: "20.00", total: & quot; 320.00 & quot "},
{ID: "19", invdate: "", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: & quot; 430.00 & quot "},
{ID: "21", invdate: "2007-10-01", name: "test", note: "NOTE", amount: "200.00", tax: "10.00", total: & quot; 210.00 & quot "},
{ID: "22", invdate: "2007-10-02", name: "Test2", note: "note2", amount: "300.00", tax: "20.00", total: & quot; 320.00 & quot "},
{ID: "23", invdate: "", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: & quot; 430.00 & quot "},
{ID: "24", invdate: "2007-10-04", name: "test", note: "NOTE", amount: "200.00", tax: "10.00", total: & quot; 210.00 & quot "},
{ID: "25", invdate: "2007-10-05", name: "Test2", note: "note2", amount: "300.00", tax: "20.00", total: & quot; 320.00 & quot "},
{ID: "26", invdate: "2007-09-06", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: & quot; 430.00 & quot "},
{ID: "27", invdate: "2007-10-04", name: "test", note: "NOTE", amount: "200.00", tax: "10.00", total: & quot; 210.00 & quot "},
{ID: "28", invdate: "2007-10-03", name: "Test2", note: "note2", amount: "300.00", tax: "20.00", total: & quot; 320.00 & quot "},
{ID: "29", invdate: "", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00 "}
];
Jquery ("# list47"). jqgrid ({
Data: mydata,
Datatype: "local ",
Height: 150,
Rownum: 10,
Rowlist: [10, 20, 30],
Colnames: ['inv no', 'date', 'client', 'amount', 'tax ', 'Total', 'note'],
Colmodel :[
{Name: 'id', index: 'id', width: 60, sorttype: "int "},
{Name: 'invdate', index: 'invdate', width: 90, sorttype: "date", formatter: "date "},
{Name: 'name', index: 'name', width: 100 },
{Name: 'amount ', index: 'amount', width: 80, align: "right", sorttype: "float", formatter: "Number "},
{Name: 'Tax ', index: 'Tax', width: 80, align: "right", sorttype: "float "},
{Name: 'Total', index: 'Total', width: 80, align: "right", sorttype: "float "},
{Name: 'note', index: 'note', width: 150, sortable: false}
],
Pager: "# plist47 ",
Viewrecords: True,
Caption: "manipulating array data"
});
</SCRIPT>