Forum
15:25
29/01/2014
I have this function to establish my JqGrid.
$('#_visitorLogGrid').jqGrid({
caption: paramFromView.Caption,
colNames: ['FundDocLineID', paramFromView.Dodic, paramFromView.Line_Item, paramFromView.Orig_RDD, paramFromView.Fiscal_Year, paramFromView.FMS_Case],
colModel: [
{ name: 'FundDocLineID', index : FundDocLineID}, //width: 20, hidden: true, key: true },
{ name: 'Dodic', index: 'Dodic', width: 300 },
{ name: 'LineItem', index: 'LineItem', width: 150 },
{ name: 'OrigRDD', index: 'OrigRDD', width: 150/*, formatter: datefmt*/},
{ name: 'FiscalYear', index: 'FiscalYear', width: 120},
{ name: 'FMSCase', index: 'FMSCase', width: 70, align: "center" }
],
hidegrid: false,
pager: jQuery('#_FundDocsEditPager'),
sortname: 'FundDocLineID',
rowNum: paramFromView.PageSize,
rowList: [10, 20, 50, 100],
sortorder: "asc",
width: paramFromView.Width,
height: paramFromView.Height,
datatype: 'json',
caption: paramFromView.Caption,
viewrecords: true,
mtype: 'GET',
jsonReader: {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
userdata: "userdata"
},
url: paramFromView.Url
}).navGrid('#_visitorLogPager', { view: false, del: false, add: false, edit: false, search: false },
{ width: 400 }, // default settings for edit
{}, // default settings for add
{}, // delete instead that del:false we need this
{}, // search options
{} /* view parameters*/
).navButtonAdd('#_visitorLogPager', {
caption: paramFromView.DeleteAllCaption, buttonimg: "", onClickButton: function () {
if (confirm(paramFromView.DeleteAllConfirmationMessage)) {
document.location = paramFromView.ClearGridUrl;
}
else {
$('#_visitorLogGrid').resetSelection();
}
}, position: "last"
});However it is currently failing at line 7 column 5 with FundDocLineID is undefined. I copied this code right out of the example at http://www.codeproject.com/Articles/594150/MVC-Basic-Site-Step-jqGrid-In I altered it accordingto code at http://blogs.teamb.com/craigstuntz/2009/04/17/38229/ But the error persists. (Interestingly enough the first code yesterday yielded object undefined at that location. Now the error has changed.)
Can someone point out where I went wrong?
13:16
Moderators
30/10/2007
Hello,
Of course there will be a error:
replace
...
colModel: [
{ name: 'FundDocLineID', index : FundDocLineID}
...
with thie one
...
colModel: [
{ name: 'FundDocLineID', index : 'FundDocLineID'}
...
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
15:48
29/01/2014
Thank you for your prompt reply.
Yes I had that pointed out to me by someone else as well. duh!
However now it is back to showing the original error, (which I mentioned at the end of my above post),
Unhandled exception at line 7, column 5 in http://localhost:51715/Scripts.....ildGrid.js
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support this property or method
16:58
29/01/2014
Revised function to look exactly like that provided on example page: http://haacked.com/archive/200.....-mvc.aspx/
$('#_FundDocsEditGrid').jqGrid({
url: "/FundDocs/GetData/",
datatype: 'json',
mtype: 'GET',
caption: paramFromView.Caption,
colNames: ['FundDocLineID', 'Dodic', 'Line Item', 'Orig RDD', 'Fiscal Year', 'FMS Case'],
colModel: [{ name: 'FundDocLineID', index: 'FundDocLineID', width: 1, hidden: true, key: true },
{ name: 'Dodic', index: 'Dodic', width: 300 },
{ name: 'LineItem', index: 'LineItem', width: 150 },
{ name: 'OrigRDD', index: 'OrigRDD', width: 150/*, formatter: datefmt*/ },
{ name: 'FiscalYear', index: 'FiscalYear', width: 120 },
{ name: 'FMSCase', index: 'FMSCase', width: 70, align: "center" }
],pager: jQuery('#_FundDocsEditPager'),
rowNum: 10,
rowList: [10, 20, 50, 100],
sortname: 'FundDocLineID',
sortorder: "desc",
viewrecords: true,
caption: "Fund Docs Lines"
});
Error report
Unhandled exception at line 7, column 5 in http://localhost:51715/Scripts/FundDocsLinesShowGrid.js
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support this property or method
"$" of function is line 7 column 5 of file.
Most Users Ever Online: 715
Currently Online:
33 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66