Forum


03:15

06/08/2008

jqgrid has been great for me so far and I tried the navigator options
the issue I face is having different urls for editing..
onload whichever edit/add button is clicked first then the option is taken.. and the options that i set below will be disregarded…
say i click on edit.. the edit url will be edit.jsp .. my add function will also be linked to edit.jsp…
is there a way to specify? or what is passed through to notify that it is an edit/add/delete??
jQuery("#search").jqGrid({
url:'data.jsp',
datatype: "json",
colNames:['id','filename'],
colModel: [{name:'id',index:'id',width:255,sortable:true,editable:false},
{name:'filename',index:'filename',width:255,sortable:true,editable:true}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pagersr'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
loadError: function (xhr,st,err){
alert("Error"+": "+st+"\\n"+xhr.responseText);
},
height:'100%',
caption:"File Listing"
.navGrid('#pagersr',
{}, //options
{height:480,url:'edit.jsp',reloadAfterSubmit:true}, // edit options
{height:480,url:'add.jsp',reloadAfterSubmit:true}, // add options
{reloadAfterSubmit:true}, // del options
{} // search options
);
});
03:24

Moderators
30/10/2007

You vcan use beforeShowForm event in booth add and edit something like
//for add
beforeShowForm: function(form_id){
$("#mygrid").setGridParam({editurl:"add.jsp"})
}
//for edit
beforeShowForm: function(form_id){
$("#mygrid").setGridParam({editurl:"edit.jsp"})
}
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.
03:50

Moderators
30/10/2007

In you case just after reloadAfterSubmit:true option
for booth
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.
04:06

06/08/2008

Thanks.. I tried that but when i used firebug it still direct to the first onclick function's url..(FIXED)
--- edit --
I tried fixing editurl: 'edit.jsp'
and use oper (edit/add) to manipulate the functions..it worked for switching of urls
may i ask is this the proper way ? but logically the height of each option should change .. in my case it did not.. so not so sure whether the grid is deteching the navigator properly ? or should i attach behaviours to the beformshowform method
sorry sorry for the trouble
08:41

01/08/2008

Hello Tony,
I'm having this exact same problem. Which ever button is clicked first sets the Edit URL rather than the two different URLs set being used.
I've tried to use the beforeShowForm code that you suggested above, but this does not work (although alerting the edit url shows that it has been changed!)
Do you have any other suggestions?
Regards,
~Dane
04:01

Moderators
30/10/2007

I have perform some test and it works fine.
In the example above you must sure that no url parameter
is used ( I mean no url in navigator or editGridRow method)
Tony
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.
Most Users Ever Online: 715
Currently Online:
86 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