Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Unable to set different update url
06/08/2008
03:15
Avatar
nintondo
Member
Members
Forum Posts: 4
Member Since:
06/08/2008
sp_UserOfflineSmall Offline

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
);
});

06/08/2008
03:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

06/08/2008
03:42
Avatar
nintondo
Member
Members
Forum Posts: 4
Member Since:
06/08/2008
sp_UserOfflineSmall Offline

sorry tony but where should i put those options and how should I set form ids?

06/08/2008
03:50
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

06/08/2008
04:06
Avatar
nintondo
Member
Members
Forum Posts: 4
Member Since:
06/08/2008
sp_UserOfflineSmall Offline

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

15/08/2008
08:41
Avatar
daniel.pool
daniel.pool
Member
Members
Forum Posts: 5
Member Since:
01/08/2008
sp_UserOfflineSmall Offline

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

17/08/2008
04:01
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
57 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information