Forum


13:48

16/11/2008

Hi.
I have this grid and subgrid
jQuery("#listsg11").jqGrid({
url:'server.php?q=4',
datatype: "json",
height: 190,
colNames:['Id', 'seccao', 'total','Data'],
colModel:[
{name:'id',index:'id', width:55},
{name:'seccao',index:'seccao', width:100},
],
rowNum:6,
rowList:[8,10,20,30],
imgpath: 'themes/sand/images',
pager: jQuery('#pagersg11'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
multiselect: false,
subGrid: true,
caption: "Grid as Subgrid",
subGridRowExpanded: function(subgrid_id, row_id) {
var subgrid_table_id, pager_id;
subgrid_table_id = subgrid_id+"_t";
pager_id = "p_"+subgrid_table_id;
rowdata = jQuery("#pagersg11").getRowData(row_id);
seccao=rowdata['seccao'];
alert(seccao);
},
My problem is in the variable seccao that never as a value the alert always
shows "undefined".
Can u tell me what i am doing wrong?
Best Regards
Snip3r
03:24

Moderators
30/10/2007

Hello,
Here is the error:
You have
rowdata = jQuery(”#pagersg11″).getRowData(row_id);
should be
rowdata = jQuery(”#listsg11″).getRowData(row_id);
The method should be applied to grid, not to pager
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.
16:41

16/11/2008

Hi Again!
I have a new probl :S, i have a third grid inside of the grid i has having the probl retreiving the data. now i need to get the data inside the second
grid into the the third but i dont now how to get the second grid name
so i can allter this->>>>"rowdata = jQuery(”secondgrid name ″).getRowData(row_id);""
i tryed passing the subgrid_table_id as argument like this:
subGridRowExpanded: function(subgrid_id, row_id,subgrid_table_id)
But the subgrid_table_id inside the expanded row is undified
Thanks in advanced
16:50

16/11/2008

If it helps where is the code
subGridRowExpanded: function(subgrid_id, row_id) {
var subgrid_table_id, pager_id;
subgrid_table_id = subgrid_id+"_t";
pager_id = "p_"+subgrid_table_id;
var rowdata = jQuery("#listsg11").getRowData(row_id);
var data = rowdata.data;
unidade = rowdata.unidade;
alert(subgrid_table_id);
$("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
jQuery("#"+subgrid_table_id).jqGrid({
url:'server.php',
datatype: "json",
colNames:['Id','id_seccao','id_unidade', 'Periodo', 'Seccao', 'Total Horas', 'Horas Extra'],
colModel:[
{name:'id',index:'id', width:55,hidden:true},
{name:'seccao',index:'seccao', width:55,hidden:true},
{name:'unidade',index:'unidade', width:55,hidden:true},
{name:'data',index:'data', width:100},
{name:'seccao_desc',index:'seccao_desc', width:100},
{name:'total',index:'total', width:80},
{name:'extra',index:'extra', width:100}
],
mtype: "POST",
postData:{q:7,unidade:uni,permissoes:perm,data:data,seccao:seccao,user:user},
rowNum:20,
pager: pager_id,
imgpath: 'themes/basic/images',
sortname: 'seccao',
sortorder: "asc",
height: '100%',
width: 650,
subGrid: true,
subGridRowExpanded: function(subgrid_id, row_id,subgrid_table_id) {
var row = jQuery("#"+subgrid_table_id).getRowData(row_id);
var data = row.data;
unidade = row.seccao;
alert(subgrid_table_id);
},
12:53

Moderators
30/10/2007

Hello,
maybe you should define variables before setting the grids
var subgrid, subsubgrid;
and set them accordantly, so that hey can be visible for
the grids
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.
Most Users Ever Online: 715
Currently Online:
65 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