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
editRow/saveRow/jgrid_array questions
04/12/2010
03:51
Avatar
wakelt
Member
Members
Forum Posts: 7
Member Since:
03/12/2010
sp_UserOfflineSmall Offline

It is my understanding that when editRow is executed, the saveRow will be executed shortly after

(assuming the key field is true). I see the editRow POST go out and things look good. I then see

another POST go out but it goes to a different URL then the editRow. It goes to an URL i used to

load some dummy data into the table to initialize it.  Is there a way to use multiple URLs to control

where the grid data gets loaded from if I want some flexibility. Can the url inside the jGrid declaration array

be a javascript variable ??

thanks, wk

04/12/2010
04:02
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Yes! All which you ask for is possible. Look at the postData parameter and this which explain how to use functions as a some properties of the postData parameter. About some other url manipulation see this old answer.

Best regards
Oleg 

04/12/2010
04:36
Avatar
wakelt
Member
Members
Forum Posts: 7
Member Since:
03/12/2010
sp_UserOfflineSmall Offline

Hi Oleg, i am afraid that I don't have the same level of jqgrid knowledge as you. The material you pointed me at is unfortunately beyond my grasp at the moment. I am hoping you can simplify for me.

I have created a grid that I can load and edit. I see the fruits of my edit posted the editurl (the editurl: is different then the url:) in the grid declaration array . I then see another get (for the grid reload) which goes to the url instead of the editurl. What steps must I take to get the reload to go to the editurl instead of the url ???

I see from the example that you create a new jquery.jqrid variable and point it at the existing grid (at least that is what I think is happening). You then reload from the new variable. I set up the new variable, put a different URL in it, to see what would happen. I didn't see a reload attempt occur ?? Also, I am very fuzzy on postData. The documentation is thin and I don't know why its useful ????

Any help would be appreciated.

thanks,

wk

04/12/2010
16:34
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello wk,

the second GET request after the POST to editurl will be done probebly because you use form editing with the default edit parameter reloadAfterSubmit:true. If you change it to reloadAfterSubmit:false.

I don't really understand what do you mean under "URL i used to load some dummy data into the table to initialize it". If you need to fill jqGrid with a data from the server, then you should use the url parameter. If you need an empty grid, then you should use datatype:'local' intead of datatype:'json' or datatype:'xml'. In the case the grid will be not filled with any data. If you will later do load some data from the server you should change the datatype value from 'local' to 'json' (or 'xml' depend on you server) and reload it. The code will be about following

jQuery("#list").jqGrid('setGridParam',{url:'myService/blabla',datatype:'json'}).trigger('reloadGrid');

In the way you can change any time the URL used to fill the grid.

If you need to change the URL only to set some server parameters (if the url has the form "base?param1=value1&param2=value2") then you can use use postData parameter additionally to url parameter. For example parameters url:"base", postData: {param1:"value1",param2:"value2"} are equivalent to one parameter url:"base?param1=value1&param2=value2". So sometime the usage of postData parameter (which also can be changed any time) has advantage. In case of the usage of functions inside of postData parameter the changing of the postData can be reduced (see this old answer as an example).

I hope this information will help you.

Best regards
Oleg

05/12/2010
01:12
Avatar
wakelt
Member
Members
Forum Posts: 7
Member Since:
03/12/2010
sp_UserOfflineSmall Offline

Hi Oleg;

Thank you for being so helpful. I used the setGridParameter to alter the URL. I didn't have any luck using the postData property. I got the URL stuff figured out somewhat.

I did run into a brick wall this morning when I realize that the entire grid needs to be returned. My hope was that the row I was editing would go to the server, get worked on, and sent back to replace the source row. I could not find a simple way to merge the newly edited row with the other 3 rows that were not involved in the inline edit. Without this capability, jqgrid doesn't really help me. Do you know of an "easy" way to make this happen.

In the meantime, I've been rolling my own using lots of javascript and some php. I sure would like to use the open source, but there isn't sufficient documentation to get me over the many hurdles of learning the open source code. I think some start to finish working examples (that demonstrate to/from server) interaction would be really helpful. I know people do this stuff on their own time so I not complaining...just wishing 🙂

05/12/2010
01:58
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi wakelt,

the problem with full working examples is that the code will consist not only from the client jqGrid code, but from the server code written in one technology and assessing one type of database also with one technology. I personally not use PHP and MySQL. I use more Windows and Microsoft .NET technologies. If I find a Java code it will help me not really. Some code can be written very close to XML. If other need JSON the code must be also adapted.

If I use for example .NET on the server side I have many choices. The most important are: ASP.NET MVC, WFC service or ASMX web service. The access to the Microsoft SQL Server could be using LINQ to SQL, Entity Framework, with SqlDataAdapter or SqlCommand and SqlDataReader. You can implement ASP.NET MVC, WFC service as RESTful services or not. I can continue. What I want to say is there are too many design choices which you have to made. All there will follow to different server code in many possible languages.

It is a main reason why it is difficult to find the whole code example which you can use.

If you use .NET, C# and some from above listed technologies I could post you some links where you will find the corresponding working code.

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
52 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