PDA

View Full Version : toolbar do not render in gridPanel



Wolfie
1 Jul 2010, 1:40 AM
Hi all

I have Panel with this configuration :



var cardWizard = {
id:'card-wizard-panel',
//title: 'Card Layout (Wizard)',
layout:'card',
activeItem: 0,
bodyStyle: 'padding:15px',
defaults: {border:false},
bbar: ['->', {
id: 'card-prev',
text: '« Previous',
handler: cardNav.createDelegate(this, [-1]),
disabled: true
},{
id: 'card-next',
text: 'Next »',
handler: cardNav.createDelegate(this, [1]),
disabled: true
}],
items: [{
id: 'card-0',
items: [new Ext.form.FieldSet({
title: 'Krok 1 z 4 - Wybór obiektów',
items: [
this.choseObjCombo,
this.reportObjectTextArea
]
})
]
},{
id: 'card-1',
items: [
new Ext.form.FieldSet({
autoHeight: true,
title: 'Krok 2 z 4 - Wybór widocznych kolumn na raporcie',
items: [
this.helperPanel,
this.reportColumnGridPanel <------
]
})
]
},{
id: 'card-2',
html: '<h1>Congratulations!</h1><p>Step 3 of 3 - Complete</p>'
}]
};
In the code above I marked with arrow grid Panel class which looks like this :



ReportColumnGridPanel = function(config)
{
config = config || {};

this.recordColumnGridPanelstore = new Ext.data.ArrayStore({
fields: [
{name: 'rec_id'},
{name: 'name'},
{name: 'parameter'},
{name: 'func'}
],
idIndex: 0
});

this.tToolbar = new Ext.Toolbar({
items: [{
// xtype: 'button', // default for Toolbars, same as 'tbbutton'
text: 'Usu?'
}]
});

ReportColumnGridPanel.superclass.constructor.call(this,{
title: 'Kolumny raportu',
tbar: this.tToolbar,
store: this.recordColumnGridPanelstore,
colModel : new Ext.grid.ColumnModel({
defaults: {
sortable: true
},
columns: [
{id: 'rec_id', header: 'Id', dataIndex: 'rec_id', hidden: true},
{id: 'name', header: 'Obiekt', dataIndex: 'name'},
{id: 'parameter', header: 'Parametr', dataIndex: 'parameter'},
{id: 'func', header: 'Funkcja', dataIndex: 'func'}
]
}),
viewConfig: {
forceFit: true
},
stripeRows: true,
//autoHeight: true, <-----
autoWidth: true
//autoExpandColumn: 'name'
});
};
Ext.extend(ReportColumnGridPanel, Ext.grid.GridPanel, {});
This class contains toolbar which goes to gridPanel tbar parameter,

The problem is that when I am running the code the toolbar does not apears (is not rendering) when I'am giving any height paremeter to GridPanel, whithout any height it's ok, but I need autoHeight : true in GridPanel

I know that is because card layout, but I need it also....

Any ideas?

Animal
1 Jul 2010, 1:46 AM
Why are you embedding a FieldSet in your no-layout card?

A FieldSet with no layout specification?

Wolfie
1 Jul 2010, 2:50 AM
Fieldset has default form layout so I do not change it and card according to examples doesn't have any layout,

could you give any working example or explain where is the problem cause I don't understand what exactly is the problem?

Animal
1 Jul 2010, 3:02 AM
First is to decide exactly how you want things to be layed out.

You need two items in a card:



this.helperPanel,
this.reportColumnGridPanel <------


How do you want them arranged and sized?

Two boxes one on top of the other, or side by side?

And how do you want the available space in the card to be distributed.

When you have thought about that, then we can select a layout which does that for you.

Wolfie
1 Jul 2010, 3:28 AM
But I already have everything layed out and the window looks like this :

21215

Here the GridPanel is without autoHeight paremeter so u can see top toolbar.....

Animal
1 Jul 2010, 3:32 AM
What if the Grid contains 100 rows?

Wolfie
1 Jul 2010, 3:49 AM
That's why I posted this topic here!.....cause I need autoHeihgt parameter in GridPanel and also top toolbar which is not rendering with autoHeight parameter ! do u understand now ?

Animal
1 Jul 2010, 3:59 AM
You do NOT need autoheight.

That would mean a grid with 100 rows would overflow your card.

The WHOLE CARD would then have to be scrolled, losing sight of the inputs AND THE GRID HEADERS.

Grids perform scrolling WITHIN THEIR SET SIZE.

What you need in your card is

The "Pojazdy" FieldSet taking its natural height.
The "Opony" FieldSet taking its natural height.
The Kolumny raportu GridPanel taking the remaining height.

If we get clear on this, I'll show you how.

Wolfie
1 Jul 2010, 4:08 AM
Ok, but even if I set fixed height for gridPanel the toolbar doesn't render, moreover, the card is quite enought high to hold and show more than one record in grid panel. Problem is not in height and layout but with rendering toolbar......which is I don't know why connected with height paremeter of grid panel

Animal
1 Jul 2010, 4:19 AM
Do you want me to help or not?

Wolfie
1 Jul 2010, 4:27 AM
Of course I want...but you are all the time telling me things that are not helpful or asking obvious questions....please focus on solving problem

Animal
1 Jul 2010, 5:08 AM
OK. I'll leave you to it. Best of luck.

Wolfie
1 Jul 2010, 5:24 AM
Oh, thanks a lot, so why u r on this forum in that case ?

Enybody else can help without useless discussion ?

Wolfie
2 Jul 2010, 2:09 AM
Oh, so if he has so many posts that means he is your authority? I am not suprised why he has so many if he is asking questions instead of answering. By the way, I don't need your help even if u would beg for it. Jerk.

Help for free, that's why forums arise. I don't need your help, but help of someone who wants to share his experience and knowledge and as I can see, you are not this type of man.

Condor
2 Jul 2010, 2:26 AM
Animal can be a bit impatient sometimes. He expects you to read the API docs thoroughly on the subjects he mentions (which unfortunately hardly anybody does).

He was suggesting that you use a layout that would make the fieldset take up the entire card and within the fieldset a layout that would make the grid take up the remaining space.

Example:

id: 'card-1',
hideMode: 'offsets',
layout: 'fit',
items: [
new Ext.form.FieldSet({
title: 'Krok 2 z 4 - Wybór widocznych kolumn na raporcie',
layout: 'vbox',
layoutConfig: {align: 'stretch'},
items: [
this.helperPanel,
Ext.apply(this.reportColumnGridPanel, {
flex: 1
}
]
})
]

Wolfie
2 Jul 2010, 6:00 AM
Thanks a lot for an answer Condor, it's much more helpful :), after some code modificiations the problem with toolbar is over

Thanks

Condor
2 Jul 2010, 6:06 AM
You probably wouldn't have this problem if you removed helperPanel and put the two fieldsets directly into the surrounding fieldset.

Wolfie
2 Jul 2010, 6:18 AM
It's imposible, cause I am dynamicaly adding fieldsets with comboboxes in previous step, and I can have one or more of them, almost without limitations
------------------------------------------------------------
I don't know to which version of my previous post u have answered, but now it's ok ;)

thanks

Condor
2 Jul 2010, 6:22 AM
So, what's impossible about that? You just keep insert()-ing fieldsets with a combobox into the vbox fieldset.