Forum
Topic RSS
23:51
26/08/2010
OfflineHi,
For some reason I am getting Javascript error when I am trying to search or sort the grid.
I read all the documentation and stuff but couldn't figure out.. kindy help !!
Error:
Object doesn’t support this property or method
jquery.jqGrid.min.js Line: 19
Code:0 Char: 161
Not sure if I am missing any js file or anything else.. Following is the list of js and css I have included.
Following is the grid:
< link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.4.custom.css" type="text/css" media="all" />
< link rel="stylesheet" href="css/ui.jqgrid.css" type="text/css" media="all" />
< script type="text/javascript" src="<s:url value="/js/jquery.js"/>"></script>
< script type="text/javascript" src="<s:url value="/js/i18n/grid.locale-en.js"/>"></script>
< script type="text/javascript" src="<s:url value="/js/jquery.jqGrid.min.js"/>"></script>
<script type="text/javascript">
$(function() {
$("#grid").jqGrid({
url:data.action',
datatype: "json",
mtype: "GET",
loadonce:false,
colNames:['Name','Id', 'RO', 'Sion','Gion','Requested Date/By'],
colModel:[
{name:'name', index:'name', align:"left", sortable:true},
{name:'Id', index:'Id', align:"left", sortable:true},
{name:'ro', index:'ro', align:"left", sortable:false},
{name:'sion', index:'sion', align:"left", sortable:false},
{name:'gion', index:'gion', align:"left", sortable:false},
{name:'requestedByDt', index:'requestedByDt', align:"left", sortable:false}
],
jsonReader : {
root: "rows",
page: "page",
total: "total",
records: "records",
cell: "cell",
id: "id"
},
rowNum:10,
autowidth:true,
height:"100%",
rowList:[10,20,30],
pager: '#pgrid,
sortname: 'id',
viewrecords: true,
caption:" test",
rownumbers: true,
rownumWidth: 15,
altRows: true,
shrinkToFit: true
});
$("#grid").jqGrid('navGrid','#pgrid',{del:false,add:false,edit:false},{},{},{},{multipleSearch:true});
});
</script>
Thanks for looking, any help is much appreciated
18:00
10/08/2009
OfflineYou should replace the lins
url:data.action',
and
pager: '#pgrid
to the
url:'data.action',
and
pager: '#pgrid'
I recommend you alway verify your JavaScript program in a debugger or/and in http://www.jslint.com/. Moreover I would recommend you remove all default values from the jqGrid options (loadonce:false, jsonReader and so on) and colModel (like align:"left" and index identical to the name). The unneeded parameters make your program not so easy to read and it will be more slow downloaded and run.
Moreover verify, that you select all jqGrid modules during downloaded from the http://www.trirand.com/blog/?page_id=6 page. Try select all, download and retry the test.
Best regards
Oleg
23:15
26/08/2010
OfflineHi Oleg,
I corrected the code, it was while copy-paste those single quotes got missed but i confirmed they were still in code.
If I remove "loadonce:true" from the attributes than both searching and sorting became server side. While I want to handle them in client -side as I won't have a huge data set.
So if I remove loadonce:true it sends request to server and can sort there. but I want to do clientside sorting and searching.. Can we fix this Javascript error somehow ...
Object doesn’t support this property or method
jquery.jqGrid.min.js Line: 19
Code:0 Char: 161
I tried putting new release as suggested by you but it is still giving same JS error..
Question: how do I specify data type of column in the model.. and what will happen for date fields ??
Do you think I am missing any js file. Because all this was working fine when I also included ....loader.js but was getting other JS errors.
Thanks
00:04
10/08/2009
OfflineHi deepak_ahu,
I recommended you remove default value loadonce:false (see code from your first post) and not loadonce:true like you write in your last post.
You should post a link with your test grid or post your test JSON data posted from the server.
For the usage of data type see http://www.ok-soft-gmbh.com/jq.....avient.htm and /client-side-date-sorting-is-not-working/.
Best regards
Oleg
01:27
26/08/2010
OfflineThanks Oleg for your suggestion.
I included
<
script type="text/javascript" src="<s:url value="/js/src/jquery.searchFilter.js"/>"></script>
and things seem to be working fine now..
I have one question though.. how to we word-wrap header and cell data ??
i haven't searched the forum yet.. but will do it.. if you have any suggestions would appreciate.
Thanks
Deepak
01:48
10/08/2009
OfflineI wrote before that you should post the full code or a link to this. Do you tried to select all jqGrid modules during downloaded from the /?page_id=6 and http://stackoverflow.com/quest.....in-one-row.
Regards
Oleg
Most Users Ever Online: 994
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
Log In
Home