Forum
15:43
07/11/2012
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");
});
15:53
10/08/2009
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
Most Users Ever Online: 715
Currently Online:
54 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66