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
editurl not changed
03/11/2009
05:38
Avatar
Yajo
Guest
Guests

Steps to reproduce bug:

1. Create a grid with an editurl and editable rows.

var grid = jQuery('#blabla').jqGrid({

   ...,

   editurl: "page.php?parameter=hello"

});

2. Change the editurl parameter.

grid.setGridParam({editurl:"page.php?parameter=bye"});

3. Check it has been changed successfully.

grid.getGridParam('editurl'); // returns "page.php?parameter=bye"

4. Edit one row and save it. You will see that the ajax call goes to "page.php?parameter=hello".

I think it's not an error in my code... can you please fix this? Thanks a lot, be happy Wink

04/11/2009
04:49
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks - where you do (in which event or pice of code) the call.

grid.setGridParam({editurl:”page.php?parameter=bye”});

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.

05/11/2009
05:05
Avatar
Yajo
Guest
Guests

Hi, Tony,

I use it to filter the grid, when the user changes the value of some filters. Details:

I have a couple of custom inputs with default values as follows:

<input id="desde" value="01/11/2009" onchange="changeFiltroFecha(this);" />

<input id="hasta" value="30/11/2009" onchange="changeFiltroFecha(this);" />

And the default value for editurl is:

"?desde=01/11/2009&hasta=30/11/2009&action=autoJqGridRequest"

Both inputs have a onchange event wich calls to this function, which replaces the corresponding parameter into the url string:

function changeFiltroFecha(elem){
    elem = jQuery(elem);
    var grid = jQuery('#grid_cuadranteAzafatas');
    grid.setGridParam({
        url: replaceUrlPart(grid.getGridParam('url'), elem.attr('id'), elem.val()),
        editurl: replaceUrlPart(grid.getGridParam('editurl'), elem.attr('id'), elem.val()),
        page: 1
    }).trigger('reloadGrid'); // <-- When relaoading, ajax calls to the OLD editurl...
    alert(grid.getGridParam('editurl')) // <-- ... but this shows the NEW one, so it's not my fault 😛
}

function replaceUrlPart(url, tag, newValue){
    return url.replace(RegExp('(\\\\?|&)' + tag + '=[^&]*'), '$1' + tag + '=' + newValue);
}

I hope it's useful to you, and you can fix this.

By the way, excellent job with your plugin, I love it Wink, thanks a lot.

Regards,

Yajo.

05/11/2009
09:28
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Could you please try with the jqGrid3.6RC

Thanks

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.

06/11/2009
03:10
Avatar
Yajo
Guest
Guests

Hi Tony,

I just tried, and it fails the same way, so I started to look for the error and finally I found it.. it's mine Frown

I'm very sorry to make you lose your time. My problem was in the editRow function. It has one parameter for the editurl, and I was passing there the same value all the time.

By the way, when trying the 3.6RC I got a new error ("val is null") and had to change line 587 of grid.common.js to:

if (val == null || val.match(/^s+$/) || val == "")    {

I hope it's useful to you.

Thanks and sorry again,

Yajo.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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