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
support dataUrl as function
08/11/2012
19:07
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

I read frequently the requirement to use dataUrl with additional parameters like rowid or some other values from the current row. Currently I suggest in the case the solution like described here: to use data parameter of ajaxSelectOptions, where one get the value of currently selected row. The way could wotk in many scenarios, but it's not safe especially in multiselect scenario.

I suggest to allow to define dataUrl as function which will get some parameters (like options.id, options.name, ...) which describes the context. In general one can just include testing whether dataUrl is a function in the line like this and if needed one can call the function with the corresponding parameters from the current context.

Best regards
Oleg

27/04/2013
14:32
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

there are exist more and more public services which supports RESTful API. For example Windows Azure Mobile Services REST API an example. The exsiting services can require to use rowid as the part of URL (see here and here for example). The current implementation of Save button of inlineNav or the implementation dataUrl of still don't allow to modify the URL by appending "/" + encodeURIComponent(rowid). The feature postData as function allows to post rowid, but not as the part of URL.

The most simple and flexible change in jqGrid code seems to me still to allow usage of function as the value of url (or surl, dataUrl). If one just change the line

url: options.dataUrl,

in the same way as the line with data option

data: $.isFunction(postData) ? postData.call($t, rowid, vl, String(options.name)) : postData,

it will get the most flexibility. I mean the code like

url: $.isFunction(options.dataUrl) ?
         options.dataUrl.call($t, rowid, vl, String(options.name)) :
         options.dataUrl,

The same changes one could do in other parts of jqGrid where jQuery.ajax are used. The most important place seems for me saveRow, bacause there are no way to modify url dynamically especially in case of usage "Save" button of inlineNav.

Simple modification of the line 

url:o.url,

to something like

url: $.isFunction(o.url) ? o.url.call($t, rowid, tmp3) : o.url,

will give developer full flexibility to generate URL dynamically.

Best regards
Oleg

29/04/2013
11:48
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello Oleg,

Thanks. I will try to implement this later.

Kind 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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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