Forum


12:37

04/03/2009

I am very new to jqGrid. I have managed to get a jqGrid working on my localhost as per demos and examples. BUT... I have not been able to get the refresh, search or any of the other add, edit, delete buttons to show on my grid.
i have checked and re-checked all the Forums... but no luck
Is there a FULL CODE EXAMPLE (i.e. all the includes, html, the whole thing) someone can point me to?
Desperate.... deadline to meet.
09:03

12/02/2009

Rest assured, this does work! My source may be a bit more than you want, but I will send it to you via email if you contact me at john(dot)navratil(at)sbcglobal(dot)net.
Assuming you have the grid working as you like, the navgrid options are what you need. Your HTML should include elements for both the grid and the pager (the navGrid), for example:
<table id="grid" class="scroll">
</table>
<div id="pager" class="scroll" style="text-align:center;">
</div>
You can chain the navgrid method after your jqGrid method call, like
jQuery("#grid").jqGrid({
... your grid options here ....
}).
navGrid("#pager",
{refresh: true, edit: false, add: true, del: true, search: true},
{ // edit
beforeSubmit: function() { alert('before edit submit'); }
},
{ // add
beforeSubmit: function() { alert('before add submit'); }
},
{ // delete
beforeSubmit: function() { alert('before delete submit'); }
}
);
Note: the navGrid method needs the id of the HTML element for the pager. The next argument specifies which buttons to attach. Here I do not have edit, but have selected add and deleted. Following that are options for the edit, the add and the delete button, respectively.
I'm using jgQrid 3.4. If you have the latest pdf documentation, refer to page 69. It's the "Properties, Events and Methods" of the "Navigating" chapter.
Most Users Ever Online: 715
Currently Online:
42 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