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
setGridParam works strangely
19/03/2013
15:43
Avatar
istiti
Member
Members
Forum Posts: 29
Member Since:
07/11/2012
sp_UserOfflineSmall Offline

Hello, 

I have my two variable

my variable mydata1 have 30 rows 

my variable mydata2 have 5 rows

 And I want to switch these two data in my default jqGrid option. Actuallay default options are:

datatype: 'local',

data: mydata1


but When I try to change data(with a click event) by another variable mydata2 who have 5 rows… In the GRID just 5 first rows are changing…the rest are always there…. Why there is this reaction  please ? I need to change data completly… 

This is click event:

$('.changeDate').click(function() {

grid.setGridParam({

datatype : 'local',

data : mydata2

}).trigger("reloadGrid");

});

19/03/2013
15:53
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

It's important to understand, that setGridParam method don't analyse implementation specific of any parameters which one can set. The code of the method is very short and simple (see here). It uses juse $.extend(true, ...) jQuery method.

What you can do for example is getting the reference to internal parameter using getGridParam. Then you can either assign the new value mydata2 to the data. Alternatively you can assign it first to empty array and then you can use setGridParam method in the same way like you already do it.

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 496

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