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_Related Related Topics sp_TopicIcon
editOptions seems bugged for url attribute
17/04/2013
17:44
Avatar
DaGLiMiOuX
New Member
Members
Forum Posts: 2
Member Since:
17/04/2013
sp_UserOfflineSmall Offline

Hi all.

Well, my problem starts since I tried to do a grid with a subgrid. Already got it, a grid with another grid as a subgrid. I thought that the best way to edit the information that I recieve from the API server was to put a column with formatter: 'actions'. That offers me to edit each row as inline edit and another delete button, to simply delete that row.

I tried to send the edit and delete data serialized in JSON format. Had to search and search through internet… but I did not find anything useful. Not enough information through internet about how to do that. Atleast, I posted at StackOverflow my problem and Oleg helped me a lot.

He told me that to do that I need to add this at the beginning of my script.

$.extend($.jgrid.defaults, {

ajaxRowOptions: {contentType: "application/json", dataType: "json"…},

serializeRowData: function(data) { delete data.oper; return JSON.stringify(data); }

});

That to send edited data inline serialized. Thats too hard to know. Someone could do something easier if possible…

Well, leaving this apart, Its supposed that if I have an inline editing, at formatoptions in actions column in my colModel, I could use editOptions: {…} to set properties for inline editing like URL. Already used delOptions{…} and could set an URL to send the id of the row deleted and could set the serializeDelData to send that row in JSON format, but for editing I use URL property at editOptions and it doesnt work. It uses the URL of the iframe which is located.

I dont know if it is clear, but I think that is a bug. I did not defined an editUrl or something that could make that jqGrid goes "crazy".

If it is not a bug, I'd appreciate that someone gives me a solution.

If you need more information or need to clarify something, just ask me.

Thanks and greetings.

21/04/2013
10:42
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Yes the best way is to prepare a test  case.

Regards

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.

22/04/2013
12:22
Avatar
DaGLiMiOuX
New Member
Members
Forum Posts: 2
Member Since:
17/04/2013
sp_UserOfflineSmall Offline

Problem solved. Oleg showed me that there is an only way to define URL parameter for inlineEditing when you are using 'actions' column (edit and delete buttons column near each row).

You have to set 'url' property at 'formatOptions', that will be default URL for editing and delete rows unless you specify on 'delOptions' another URL at 'url' property of 'delOptions' or 'url' property of 'editOptions' (ONLY for form editing). Inline edit options don't have a property like those to specify an URL, then it uses 'default' URL editing specified at 'url' property of 'formatOptions'.

I hope this will help to someone that had my same problem.

Best regards.

22/04/2013
12:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Please look at editurl option into the documentation.

Regards

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.

22/04/2013
13:08
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Just for clearing of reason I wanted to add my comment here. The error of was because of not enough clear documention of the options of parameters of formatOptions of the formatter: "actions". One can read in the documentation just the names of options. One can find editOptions, delOptions and many other options including the option url. One could misunderstand the option url as common URL option where editOptionsdelOptions could contains separate URLs for editing and delete. Espesially the people who worked before with inlineNav could though so.

The problem is that formatter: "actions" supports editformbutton: true option. Only if one examins the source code of jqGrid one will see that properties of editOptions (inclusive the url property of editOptions) will be used only in case of form editing (in case of editformbutton: true). The inline editing methods uses properties defined directly in formatOptions.

So

formatOptions: {
    url: "inlineEditingUrl",  // used for inline editing
    editOptions: { // defines only form editing options
        url: "formEditingUrl" // use only with editformbutton: true
    },
    delOptions: {
        url: "formEditingDeleteUrl"
    }

I described the problem in "UPDATED 2" part of my answer.

Best regards
Oleg 

23/04/2013
16:16
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello Oleg,

It is true, but it is really very difficult to support the docs in perfect way.

Anyway we continue to improve the grid and will try to make it easy for more users.

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:
63 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