PDA

View Full Version : grid inside tabpanel inside form iinside window doesn't appear



senacle
4 Jun 2011, 12:02 PM
Hello !

All is in the title.

I've a window.
Inside this window is a formpanel.
Inside this formpanel is a tabpanel.
Inside this tabpanel is a gridpanel.

But the gridpanel is not displayed.

I've searched a lot, but i did not find nothing.

If you can help :)

The window :


var fenetre_offre_ajout = new Ext.Window({
autoHeight: true,
border: false,
closable: true,
closeAction: 'hide',
hidden: true,
id: 'idjs_fenetre_offre_ajout',
items:[
form_offre_ajout
],
modal: true,
resizable: false,
shadow: 'drop',
shadowOffset: 10
});


The formpanel and tabpanel :
(a light version of my formpanel, the problem is the same)


var form_offre_ajout = new Ext.FormPanel({
items: [{
activeTab: 0,
border: false,
defaults: {autoHeight:true},
id: 'idjs_tab_form_offre_ajout',
items:[{
defaults: {
labelStyle: 'font-weight:bold; color:#990033;',
width: 300
},
defaultType: 'textfield',
items: [{
allowBlank: false,
fieldLabel: 'Date de fin ',
id: 'idjs_date_fin',
name: 'date_fin',
xtype: 'datefield'
}],
layout:'form',
title: 'Détail de l\'offre'
},{
items: grille_produit_detail,
title: 'Produits'
}],
padding: '5px 0 0 5px',
plain: true,
xtype:'tabpanel'
}],
width: 550
});


The gridpanel :


var grille_produit_detail = new Ext.grid.GridPanel({
autoHeight: true,
border: false,
clicksToEdit: 2,
columns: [{
dataIndex: 'numero',
header: 'N° ',
sortable: true,
width: 150
},{
dataIndex: 'aaaa',
header: 'aaaa',
width: 60
},{
dataIndex: 'bb',
header : 'bb',
width : 200
},{
dataIndex: 'cc',
header : 'cc',
width : 200
},{
dataIndex: 'dd',
header : 'dd',
width : 200
},{
dataIndex: 'ee',
header : 'ee',
width : 60
},{
dataIndex: 'ff',
header : 'ff',
sortable : true,
width : 150
}],
frame: true,
height: 400,
id: 'idjs_grille_produit_detail',
stripeRows: true,
store: store_produit,
tbar: [{
handler : function(){
var gn = grille_produit_detail.getStore().recordType;
var p = new gn({
aaaa: 'Nouveau',
bb: '',
cc: ''
});
grille_produit_detail.stopEditing();
store_produit_detail.insert(0, p);
grille_produit_detail.startEditing(0, 0);
},
iconCls: 'icon-add',
scope: this,
text: 'Ajouter'
}, '-', {
handler : function(){
var index = grille_produit_detail.getSelectionModel().getSelectedCell();
if (!index) {
return false;
}
var rec = grille_produit_detail.store.getAt(index[0]);
grille_produit_detail.store.remove(rec);
},
iconCls: 'icon-delete',
scope: this,
text: 'Supprimer'
}],
viewConfig: {
forceFit:true
}
});

senacle
5 Jun 2011, 7:33 AM
You know what ?

It's because the grid was declared after the form...

Firebug didn't say me anything about this...