PDA

View Full Version : Expander problem for IE8



ClassNotFound
20 Mar 2013, 6:35 AM
Hi all,

I had a very unusual problem when i want to recive some data from the controller for my store in .jsp.

Generally, i wanna expand a grid in a row who has already in a grid.

Here is my controller, it will return a JSON object to the jsp page.


@RequestMapping(value = ConstantesPartage.LOAD_SHARES_OWNER)
public @ResponseBody
String reloadGridSharesOwner(final HttpServletRequest httpServletRequest, final HttpServletResponse response,
@RequestParam("criteria") final int criteria) throws Exception {

String retour;

CriteresRechercheServeur criteresRechercheServeur = new CriteresRechercheServeur();
criteresRechercheServeur.setId(criteria);

ArrayList<SharesOwner> listOfSharesOwner = (ArrayList<SharesOwner>) this.serveurService.getExpandSharesOwner(criteresRechercheServeur);
retour= JsonUtil.encodeArrayToJson(listOfSharesOwner,httpServletRequest);
return retour;
}

I've checked this baby for like a million times, so i guess it should be the problem here.

And in my jsp pages, i've used a JSON store to deal with the data:


var storeSharesOwner = new Ext.data.JsonStore(
{
url: link_shares_search_controller+'/load-shares-owner.do'
,method: 'POST'
,baseParams:
{
criteria : ''
}
,fields: [
{name: 'id_partage', type:'int'}
,{name: 'nom_partage'}
,{name: 'listOwner'}
]
});


And here is the part with problem


//****Row expander****
var expander = new Ext.ux.grid.RowExpander({
tpl : new Ext.Template(
'<br/><div id=\"server-{id}\"></div>'
)
});

expander.on('expand', function (obj, record, body, rowIndex) {
//Load the data
Ext.getCmp('id_grid_show_view_servers').getEl().mask(loading_generic_sequence);
storeSharesOwner.baseParams.criteria=record.data.id;
storeSharesOwner.load();
storeSharesOwner.on('load', function(){
//Problem here!!!!!!!!!!!!!!
Ext.getCmp('id_grid_show_view_servers').getEl().unmask();
});

new Ext.grid.GridPanel({
id: 'id_grid_show_view_shares_owner'
,renderTo: 'server-'+record.data.id
,border: true
,store: storeSharesOwner
,layout:'fit'
,width: 680
,height: 280
,trackMouseOver: true
,disableSelection: true
,stripeRows: true
,columns:
[
{header: "<spring:message code='prtg.tableHeaderShares'/>", width: 310, sortable: true, dataIndex: 'nom_partage'}
,{header: "<spring:message code='prtg.tableHeaderOwner'/>", width: 320, sortable: true, renderer:sharesOwnerRenderer, dataIndex: 'listOwner'}
]
,tbar:[
{
text:"<spring:message code='prtg.topBarSharesOwner'/>"
}]
});
});

It works well in FireFox, but when i test it with IE8, it will have a error which is:


Message : 'this.innerHd.firstChild' is null or not an object.
Ligne : 11
Caractère : 147620
Code : 0
URI : http://localhost:9080/js/extjs/ext-all.js

and the grid will never be unmask.

I really have no idea whats going on here and i've be blocked for like 2 days, so if ANYBODY can help me,
IT WILL BE DELIGHTFUL!!!

Best regards

scottmartin
22 Mar 2013, 10:35 AM
It could be a syntax error, comma , or it could be something related to this topic:
http://stackoverflow.com/questions/4781617/how-to-initialize-firstchild-so-i-dont-get-x-firstchild-is-null-or-not-an-obje

Here is an UX that has nested grids in the example:
https://github.com/mitchellsimoens/Ux.grid.plugin.AssociationRowExpander

Scott.