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
getRowData in grid as subgrid
10/03/2009
22:09
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

Someone please help the newby with a problem.  I am using version 3.4.2 in a Windows environment. 

I have a grid as a subgrid.  I am trying to read data from the subgrid in the function for the subGridRowExpanded event.  getRowData and getCell come back with undefined values.  This logic works fine if it is a click function external to the subgrid but not in the subGridRowExpanded event.

What am I missing here? Code below.

Thanks,

Jerry

jQuery("#list").jqGrid({
   url:'cem_db_if.php?q=1',
   colNames:['Cemetery','USGS GNIS ID', 'County','USGS map','Location'],
   colModel :[
     {name:'cem_name', index:'cem_name', width:200, align:'center'},
     {name:'cem_usgs', index:'cem_usgs', width:100, align:'center'},
     {name:'cem_county_name', index:'cem_county_name', width:100, align:'center' },
     {name:'cem_map', index:'cem_map', width:100, align:'center'},
     {name:'cem_description_short', index:'cem_description_short', width:400, align:'center'} ],
   height:'auto',
   pager: '#pager',
   rowNum:15,
   rowList:[15,30,60],
   sortname: 'cem_name',
   sortorder: "asc",
   mtype: 'POST',
   postData:{table_name:"DT_Cemetery"},   
   viewrecords: true,
   imgpath: 'themes/basic/images',
   caption: 'TNGenWeb Cemetery Database - Cemeteries',
   shrinkToFit: 'true',
   width:880,
   subGrid:'true',
   subGridRowExpanded: function(subgrid_id, row_id) {
    var subgrid_table_id;
    subgrid_table_id = subgrid_id+"_t";
     jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>");
     jQuery("#"+subgrid_table_id).jqGrid({
      url:"cem_db_if.php?q=3&id="+row_id,
      datatype: "xml",
      colNames: ['Cemetery detail',''],
      colModel: [
       {name:"item",width:150, align:'right'},
       {name:"prop",width:200, align:'left'}],
      height:'auto',
      rowNum:20,
      imgpath: 'themes/basic/images'
     });//end subgrid
          
     //get latitude from subgrid to draw google map
     alert("#"+subgrid_table_id);
     var lat = jQuery("#"+subgrid_table_id).getRowData(6);
     alert("item="+lat.item+" prop="+lat.prop+"...");

    }//end function
  }).navGrid('#pager',{edit:false,add:false,del:false})

10/03/2009
22:50
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

I added a gridComplete function for the subgrid and moved my code there.  Works like a champ. 

I would appreciate an explanation as to why the data in the subgrid is not available immediately after the subgrid code executes.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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