Forum


18:32

21/07/2008

I just did it. in grid.base.js, do the following:
$.fn.jqGrid = function(p) {
p = $.extend([
...
myParam1: 'haha1' // default value for my parameter
myParam2: 'haha2'
...
]}
}
Then look for the following code in the same javascript file:
var populate = function() {
if (!grid.hDiv.loading) {
beginReq();
// modify the following line by adding the two parameters
var gdata = $.extend(ts.p.postData, (myParam1: ts.p.myParam1, myParam2: ts.p.myParam2, .....))
....
}
}
And then you can use the two parameters. Good luck.
09:17

08/08/2008

okay, I followed your instructions, but still can't get it to work.
I have something like that in example.html:
<script type=”text/javascript”>
jQuery(document).ready(function(){
$(”#s_search”).click(function(){
jQuery(”#list2″).jqGrid({
url:'example.php?nd='+new Date().getTime(),
….. }); });});
</script>
….
<select id=”param1” name=”param1″>
<option value=”0″ selected=”selected”>Search BY</option>
<option value=”idOrder”>No</option>
<option value=”customerName”>Client name</option>
<option value=”childName”>Child Name</option>
</select>
<input type=”text” id=”param2″ name=”param2″ value=”">
<input type=”submit” name=”s_search” id=”s_search” value=”Search”>
<table id=”list2″ class=”scroll” cellpadding=”0″ cellspacing=”0″></table>
<!– pager definition. class scroll tels that we want to use the same theme as grid –>
<div id=”pager2″ class=”scroll” style=”text-align: center;”></div>
….
now, how do I get the value of param1 and param2 in example.php?
11:05

08/08/2008

I found a way!!!
in example.html
…
<td><button onclick=”gridReload()” id=”s_search” style=”margin-left:30px;”>Search</button></td>
..
function gridReload(){
var param1 = jQuery(”#param1″).val();
var param2 = jQuery(”#param2″).val();
jQuery(”#list2″).setGridParam({url:”example.php?param1=”+param1+”¶m2=”+param2,page:1}).trigger(”reloadGrid”);}
and, in example.php
$param1 = $_REQUEST['param1'];
$param2 = $_REQUEST['param2'];
Most Users Ever Online: 715
Currently Online:
35 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