Forum


04:50

Moderators
30/10/2007

Hello,
One possible solution is to use userdata array and setColProp method combined with loadComplete event.
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.
19:59

10/11/2008

I've added the following to jqgrid
jQuery("#grid_table").jqGrid({
....
userdata: 'userData',
loadComplete: function(){
select_options2 = $('#grid_table').getGridParam("userData");
// select_options2 = {"sklep":"1:real;2:lidl;3:auchan;4:media"};
var op_sk = select_options2.sklep;
alert(op_sk);
gt2 = {'editoptions': {'value':op_sk}};
$("#grid_table").setColProp('sklep',gt2);
},
...
There is some error when I call getGridParam. Probably it doesn't get data from server properly although the JSON is sended and looks like this:
....
{"page":null,
"total":497,
"records":"497",
"rows":
[{"id_produkt":"1","cell":["1","frytki","3.49","0","1","2008-11-02","lidl","spo?ywcza"]}],
"userData":
{"sklep":"1:real;2:lidl;3:auchan;4:media"}
}
Any ideas what is wrong?
Majkel
08:57

Moderators
30/10/2007

What does not work? How look your data. Remember the last item should not end with ; - this will break the select. To make a test just put a string and see what is it - I mean
loadComplete : function () {
$("#mygrid").setColProp('myname',editoptions:{'1:one;2:two'});
}
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.
07:43

10/11/2008

Data from serwer is presented in post at 19:59 08/02/2009 in this topic:
“userData”:
{”sklep”:”1:real;2:lidl;3:auchan;4:media”}
JQGrid can't get userData from serwer.
select_options2 = $('#grid_table').getGridParam(”userData”);
if I replace above line(testing) with this:
select_options2 = {”sklep”:”1:real;2:lidl;3:auchan;4:media”};
everything is ok, but select options are just static text.
If I alert(select_options2.sklep); in case of dynamic I get a message:
undefined
If I alert(select_options2.sklep); in case of static(test) I get a message:
1:real;2:lidl;3:auchan;4:media
So the dead point is marked red
I've try olso such a construction:
select_options2 = jQuery('#grid_table').getUserData();
Most Users Ever Online: 715
Currently Online:
45 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