Forum


10:44

Moderators
30/10/2007

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.
16:49

25/02/2009

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'
});
02:25

Moderators
30/10/2007

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.
06:41

25/02/2009

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
07:05

Moderators
30/10/2007

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.
10:32

Moderators
30/10/2007

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.
11:05

25/02/2009

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>
08:15

Moderators
30/10/2007

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.
13:58

25/02/2009

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
01:24

Moderators
30/10/2007

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.
09:40

25/02/2009

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
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66