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
addJSONData after clearSearch in IE
14/10/2009
02:53
Avatar
HoSpiTaL_gHoSt
Guest
Guests

Hello,

I have a problem which only occurs in IE (I use jqgrid 3.5.3). I have a jqgrid which can be searched using a search inputfield and a searchbutton. I also have a button at the bottom of my page to sort the jqgrid on multiple columns.

When clicking that sort button,the first thing I have to do is call clearSearch, and then I do an ajax call to get my jqgrid data sorted, and i add that data to the grid using addJSONData. But in IE, when the sort button is clicked, first the values appear sorted in the grid, but immediately after that the grid data returns to its previous state. This only happens the first time after the page is loaded. When I click the sort button a second time, the data appears sorted in the grid as it should be.

I think this is because clearSearch also posts a call to the server to retrieve the data, but somehow in IE this call is executed after my own ajax call, even though I call clearSearch before my own ajax call.

function sortOnMultipleCols(){

    sg[0].clearSearch();

    //post ajax call to the server to retrieve the data sorted on multiple columns

    //the result of this call ='msg'

    $('#grid')[0].addJSONData(msg);
    $('#grid').setGridParam({sortname:'col1,col2,col3'});

}

I'm sorry if my explanation isn't very clear, please tell me if you need more information.

Thanks in advance for the help!

14/10/2009
04:47
Avatar
HoSpiTaL_gHoSt
Guest
Guests

Anyway, I solved my problem by not calling clearSearch anymore. Before it was necessary because I sorted my entire dataset on multiple columns, so I had to clear the search first. Now I just sort the search results on multiple columns, so this way I don't have to clear the search anymore.

I've changed my method to sort on multiple columns to this:

function sortOnMultipleCols(){

         $('#grid').setGridParam({sortname:'col1,col2,col3'});
         $('#grid').trigger(”reloadGrid”);

}

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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