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.
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
in the same way as the line with data option
it will get the most flexibility. I mean the code like
options.dataUrl.call($t, rowid, vl, String(options.name)) :
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
to something like
will give developer full flexibility to generate URL dynamically.
Thanks. I will try to implement this later.
Most Users Ever Online: 215
Currently Browsing this Page:
Guest Posters: 447
Newest Members: Surendra Rayapati, rize, Jamil1234, poff, hemadri, Shetty
Moderators: tony (7513), Rumen[Trirand] (81)
Administrators: admin (61)