PDA

View Full Version : How can I set Ext.view.View layout to table?



Fire-Dragon-DoL
28 Dec 2011, 7:29 AM
How can i set a Ext.view.View layout to table and set cell width/height in tpl xtemplate?

I'm using the View as a desktop-like icon visualizer, but when I set the componentLayout config property to a different layout I get "beforelayout error".

How can I solve this, if it's possible?

mitchellsimoens
28 Dec 2011, 8:37 AM
You don't set the layout config on the Ext.view.View. You should use CSS to style the HTML that is created after the data has been applied to the template.

Fire-Dragon-DoL
28 Dec 2011, 10:15 AM
Isn't a bit complicated create a "grid" with css only in this situation? My idea was to use classic html Table tag to do it

mitchellsimoens
28 Dec 2011, 10:33 AM
Isn't a bit complicated create a "grid" with css only in this situation? My idea was to use classic html Table tag to do it

That would be pretty simple to do.


new Ext.XTemplate(
'<table>',
'<tpl for=".">',
'<tr>',
'<td>{somefield}</td>',
'</tr>',
"</tpl>',
'</table>'
);

Of course there is more to be done but that is a sample of how it can be done.

Fire-Dragon-DoL
28 Dec 2011, 1:45 PM
Oh you mean in that way, thanks a lot so. This method works.