jqGrid editurl value for local editing?
Asked Answered
R

3

5

I have a jqGrid set up with local data. I'm not sending any data to the server until the entire form is filled out. My problem is, when a user adds/edits a row, jqGrid attempts to post the results to the server right then.

I tried leaving out the "editurl" attribute from the jqGrid invocation, but this results in a "No URL is set" error when the user clicks the "submit" button on the popup form for adding/editing records.

I tried putting in a single hash "#" for the editurl value, but this also fails.

Any thoughts?

Riccio answered 2/8, 2010 at 16:45 Comment(0)
P
11

editurl must be 'clientArray' in your case.

Philtre answered 2/8, 2010 at 17:8 Comment(4)
I tried setting "editurl:'clientArray'", editurl: "'clientArray'", and various other things, but all I ever got was clientArray being treated as a literal URL. I googled up "jquery clientarray" and tried implementing it as shown elsewhere, but still got nothing. I'm working with a copy of jqGrid I dl'd just last week so it's pretty recent. I'm sure I'm just not setting it right, but I did come up with a band-aid fix.Riccio
The band-aid fix is something I gleaned from trirand.com/blog/?page_id=393/help/… What I did was I set up a valid URL target that does nothing. editurl:'index.cfm?fuseaction=Ajax.doNothing'. I figure it made the pain stop, and if I do decide to use the client/server approach, I'll change my "doNothing" into a "doSomething".Riccio
You editurl:'clientArray' is supported by inline editing, but it seems to me not in form editing. In case of form editing you probably should use a dummy ajax url like you do this. An example you can find on the demo page trirand.com/blog/jqgrid/jqgrid.html choose "New in version 3.7" and then "Add/edit/delete on local data"Philtre
Hello Oleg. I also using cell edit now. But i am loading data from server in JSON format, when i edit cell and move, jQgrid immediately trying to save and says No Url is set. All i need is i just want to edit the data loaded into the grid and later i submit all the edits. My problem explained here #14663132Shoemake
E
4

Set editurl:'url', cellsubmit:'clientArray', cellEdit: true

or

here

Embree answered 1/11, 2010 at 4:52 Comment(0)
N
1

See this for a complete example of jqgrid local data.

local edit on jqgrid

Change your initial data and your columnmodel, and you will be almost done.

It's not a oneline solution, but, seems this is the way to cope local editing.

Nine answered 15/11, 2013 at 12:22 Comment(1)
thanks for sharing this. i note that the important bit is return {}; however for me this is not preventing the ajax request. will this only prevent the request when working with local data?Benign

© 2022 - 2024 — McMap. All rights reserved.