Forum


17:59

12/11/2008

I've seen this error posted several times, all seemingly resolved by changing the paths in the jquery.jqGrid.js file. I've tried that, and it does not seem to have an effect, but maybe I'm missing something obvious.
My error is:
jQuery("#list4").jqGrid is not a function
(?)()()grid.aspx (line 31)
to the wait list jQuery.readyList.push()()jquery.js (line 2294)
(?)()()jquery.js (line 2314)
each()(function () { return fn.call(this, jQuery); }, function(), undefined)jquery.js (line 745)
ready()()
I'm trying to do the load array data. My code is copied directly from the demo pages:
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.js" type="text/javascript"></script>
<script src="js/js/jqModal.js" type="text/javascript"></script>
<script src="js/js/jqDnR.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#list4").jqGrid({
datatype: "local",
height: 250,
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date"},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float"},
{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}
],
imgpath: 'js/themes/basic/images',
multiselect: false,
caption: "Manipulating Array Data"
});
var mydata = [
{id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}
];
for(var i=0;i<=mydata.length;i++)
jQuery("#list4").addRowData(i+1,mydata[i]);
});
</script>
Here are my includes:
{ include: true, incfile:'grid.locale-en.js',minfile: 'js/min/grid.locale-en-min.js'}, // jqGrid translation
/* { include: true, incfile:'grid.pack.js',minfile: ''}, */ // jqGrid all packecd
{ include: true, incfile:'grid.base.js',minfile: 'js/min/grid.base-min.js'}, // jqGrid base
{ include: true, incfile:'grid.common.js',minfile: 'js/min/grid.common-min.js' }, // jqGrid common for editing
{ include: true, incfile:'grid.formedit.js',minfile: 'js/min/grid.formedit-min.js' }, // jqGrid Form editing
{ include: true, incfile:'grid.inlinedit.js',minfile: 'js/min/grid.inlinedit-min.js' }, // jqGrid inline editing
{ include: true, incfile:'grid.celledit.js',minfile: 'js/min/grid.celledit-min.js' }, // jqGrid cell editing
{ include: true, incfile:'grid.subgrid.js',minfile: 'js/min/grid.subgrid-min.js'}, //jqGrid subgrid
{ include: true, incfile:'grid.treegrid.js',minfile: 'js/min/grid.treegrid-min.js'}, //jqGrid treegrid
{ include: true, incfile:'grid.custom.js',minfile: 'js/min/grid.custom-min.js'}, //jqGrid custom
{ include: true, incfile:'grid.postext.js',minfile: 'js/min/grid.postext-min.js'}, //jqGrid postext
{ include: true, incfile:'grid.tbltogrid.js',minfile: 'js/min/grid.tbltogrid-min.js'}, //jqGrid table to grid
{ include: true, incfile:'grid.setcolumns.js',minfile: 'js/min/grid.setcolumns-min.js'} //jqGrid setcolumns
And here is my path structure:
- root
- grid.aspx (the page the code is running from)
- js
- jquery.js (version 1.2.6)
- jquery.jqGrid.js
- js
- min
- grid.base-min.js
- other grid.xxx-min.js files
- packall
- packed
- ....
- min
Thank you for your help.
07:59

08/09/2008

Here the most important issue to setup jqGrid is the "pathtojsfiles" variable
in jquery.jqGrid.js.In my case I have a directory called "js" where I put all my javascript scripts, so I have :
var pathtojsfiles = "../js/js/packed/"; // need to be ajusted
Check with FireBug which files are been loaded...
Most Users Ever Online: 715
Currently Online:
47 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