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
expandSubGridRow
01/04/2009
17:09
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

I am having difficulty getting expandSubGridRow to work.  I did a simple test case with rowid hard coded and triggered by gridComplete and that doesn't work either.

Is expandSubGridRow supposed to work with grid as a subgrid?

Any ideas on how to debug?

Thanks,

Jerry

02/04/2009
10:44
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

To help - what does not work?

Please describe and if possible write the configuration

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.

02/04/2009
16:49
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

My grid configuration is below.  I am using jqGrid  3.4.2.

I am trying to use expandSubGridRow to restore history using rsh.  The expandSubGridRow doesn't expand the subgrid as expected.  The grid is unchanged.  After my history code didn't work, I did the simple test case below where I try to expand the first row in my table on load complete.  The row id is hard coded so I know it is correct.  The code below loads the standard grid without the expanded subgrid.

How can I debug?

Thanks,

Jerry

    $("#list").jqGrid({
        url:'cem_db_if.php?q=1&table_name=DT_Cemetery',
        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:limit,
        rowList:[15,30,60],
        sortname: sidx,
        sortorder: sord,
        viewrecords: true,
        imgpath: 'themes/basic/images',
        caption: 'TNGenWeb Cemetery Database - Cemeteries',
        shrinkToFit: 'true',
        width:880,
        gridComplete: function(){$("#list").expandSubGridRow(2084527);},
        postData:{lim_county:lim_county,lim_cem_id:lim_cem_id,history:'yes'},
        subGrid:'true',
        subGridRowExpanded: function(subgrid_id, row_id){details("DT_Cemetery",subgrid_id, row_id,2)},
        subGridRowColapsed: function() {google.maps.Unload()},
        loadui:'block'
    }).navGrid('#pager',{edit:false,add:false,del:false})
    .navButtonAdd('#pager',{
        caption:'burials', buttonimg:'', onClickButton:
        function() {burial()},
        position:"last",title:'click to change to Burial View'
       
        });

03/04/2009
02:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

And what do details function? Check to see if this function is raised - i.e. in the body of the function make alert and at the end too.

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.

03/04/2009
06:41
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

Tony,

details function does not execute.  I am using the rsh log to debug so I added log at the start and end of details and nothing shows in the log including the history.

function details(table, subgrid_id, row_id,q) {
 log(table+" details start");
 var historyData = new Object();
 historyData.sortname=$("#list").getGridParam('sortname');
 historyData.sortorder=$("#list").getGridParam('sortorder');
 historyData.rowNum=$("#list").getGridParam('rowNum');
 historyData.table = table;
 historyData.subgrid_id = subgrid_id;
 historyData.row_id = row_id;
 dhtmlHistory.add("details",historyData);
 var msg = "<b>A history event has been added:</b> [newLocation=details | historyData="+historyData.sortname+"|"+historyData.sortorder+"|"+historyData.rowNum+"|"+historyData.table+"|"+historyData.subgrid_id+"|"+historyData.row_id+"]";
 log(msg);
 $("#"+subgrid_id).load("cem_db_if.php?q="+q, {table_name:table, subgrid_id:subgrid_id, row_id:row_id});
 log(table+" details complete");
}//end details

03/04/2009
06:58
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

Tony,

I took the function details out of the picture by changing the subGridRowExpanded to just be an alert:

subGridRowExpanded: function(subgrid_id, row_id){alert("details")},

The subGrid still doesn't expand.

Jerry

03/04/2009
07:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Does the alert fire if you click on the plus image?

Regards

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.

03/04/2009
08:18
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

Yes, the alert fires if I click the plus image.  I moved the expandSubGridRow to an onclick="" and clicking the link reloads the page instead of firing subGridRowExpanded.

03/04/2009
10:32
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Just for you I have prepared a example. Go in to the demo page

and run Advanced->Grid As SubGrid.

In this code I have just added:

....

    gridComplete: function() {
        jQuery("#listsg11").expandSubGridRow("13");
    },

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.

03/04/2009
14:57
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

Tony,

Thanks for showing me that expandSubGridRow works.  I have an interaction with my history code or something.  I will back out code and see what is causing it.

jqgrid is a great thing.  Thank you for making this happen.

All the best,

Jerry

06/04/2009
11:05
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

Tony,

I have stripped the grid down to the bare bones and the expandSubGridRow still does not expand on the gridComplete event.  The alert fires so I know the gridComplete event is firing but the POST for the jQuery().load never gets sent.  I get the same result puting the jQuery().load in an external onclick="".  The subgrid works fine when I click the "+". 

I would appreciate any thoughts on how to debug further.  I don't have a clue what to do next.

Thanks for all of your help,

Jerry

<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.jqGrid.js" type="text/javascript"></script>
<script src="js/jqModal.js" type="text/javascript"></script>
<script src="js/jqDnR.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
 $("#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',
  rowNum:15,
  rowList:[15,30,60],
  sortname: 'cem_name',
  sortorder: 'asc',
  viewrecords: true,
  imgpath: 'themes/basic/images',
  caption: 'TNGenWeb Cemetery Database - Cemeteries',
  shrinkToFit: 'true',
  width:880,
  gridComplete: function(){alert('grid complete!');jQuery('#list').expandSubGridRow('2095526');},
  subGrid:'true',
  subGridRowExpanded: function(subgrid_id, row_id){$("#"+subgrid_id).load("cem_db_if.php?q=2", {table_name:"DT_Cemetery", subgrid_id:subgrid_id, row_id:row_id});},
 });
});
</script>

07/04/2009
08:15
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

The first thai I will check is:

1. The existance of the method expandSubGridRow

2. The existance of the row with id - 2095526

3. If both are present check to see if you call the grid in something special case.

In your post you point me that you use jQuery load - what you try to do with load?

Also make a code simple like the example on the demo page and see what is happen.

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/04/2009
13:58
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

Tony,

1.  Firebug reports no errors on this page so I think expandSubRowGrid exists.  I don't know how to check if it is being loaded other than to look for Firebug errors.

2.  Row with id - 2095526 exists and expands if the "+" is clicked.

3.  I don't understand what you are saying here.  All the javascript code on my test page is pasted in the post above.  No special case that I can see.

jQuery load is used to load a section of html code from the php server.  The section of html code is the subgrid.  Using html code gives more formating flexibility than just a grid.

I think my subgrid test case is equivalent to the demo example.  Don't you agree?

Thanks,

Jerry

14/04/2009
01:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

I agree, the script is equivalent to the demo page, but why this does not work?

Also put alert and see if it is lunched (before call expandSubGridRow) . If you have FireBug you can set to use the development version of jqGrid (not min version) and look in expandSubGridRow which is in grid.subgrid.js module.

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/04/2009
09:40
Avatar
jlb30504
Member
Members
Forum Posts: 41
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

Tony,

The problem was that I had subGrid:'true' instead of subGrid:true.  This caused expandSubGridRow to kick out on the test if($t.p.subGrid===true).

Sorry to waste your time on my stupid mistake.  Thank you for your help in walking me through this.  I did learn more about firebug so hopefully, I won't ask so many dumb questions in the future.

Thanks for all of your hard work on jqGrid.

Jerry

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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