-
30 Jun 2008 2:09 PM #11
Have you tried with the setContainer change I made? That works with different labelAlign options as well. You can assign labelWidth etc. as well as you would set on a form.
So, your config can be something like
Let me know what kind of issues you are encountering!Code:{ layout: 'tableform', layoutConfig: {columns: 2}, border: 'false', labelWidth: 200, labelAlign: 'top', items: [ {xtype: 'textbox', fieldLabel: 'First Name'}, {xtype: 'textbox', fieldLabel: 'Last Name'}, {xtype: 'textarea', fieldLabel: 'Remarks', colspan: 2} ] }
-
30 Jun 2008 11:41 PM #12
Yes, durlabh's solution will fix the OP's problem. It looks like the way to go.
I've posted a Feature Request that this be added to the main Ext codebase. I think that 99% of form layouts are tabular.
The vertical, linear nature of Ext.layout.FormLayout baffles first time Ext users.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
30 Jun 2008 11:44 PM #13
I think this should have the effect we are after:
And the new layout class:Code:// Make the fieldTpl available to ALL layouts Ext.override(Ext.layout.ContainerLayout, { fieldTpl: (function() { var t = new Ext.Template( '<div class="x-form-item {5}" tabIndex="-1">', '<label for="{0}" style="{2}" class="x-form-item-label">{1}{4}</label>', '<div class="x-form-element" id="x-form-el-{0}" style="{3}">', '</div><div class="{6}"></div>', '</div>' ); t.disableFormats = true; return t.compile(); })() });
Code:Ext.layout.TableFormLayout = Ext.extend(Ext.layout.TableLayout, { setContainer: function() { Ext.layout.FormLayout.prototype.setContainer.apply(this, arguments); this.currentRow = 0; this.currentColumn = 0; this.cells = []; }, renderItem : function(c, position, target) { if (c && !c.rendered) { Ext.layout.FormLayout.prototype.renderItem.call(this, c, 0, Ext.get(this.getNextCell(c))); } } }); Ext.Container.LAYOUTS['tableform'] = Ext.layout.TableFormLayout;Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
1 Jul 2008 12:01 AM #14
animal, with your override from post #13 i get this error (on 2.1svn):

p.s. anyway to get anchors working with this?
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
1 Jul 2008 12:05 AM #15
Good tip, I have not tried the code though, but I will.
I'm wondering if the new layout need a destroy override...
The benefit of making the fieldTpl available to all layouts is because then you can use it to render fields in all the layouts...but it works only if you use the renderItem of the form layout for now...
Am I correct?
Thanks and keep up the good work
-
1 Jul 2008 12:19 AM #16
-
1 Jul 2008 12:24 AM #17
Mystix, I just fixed the code in the post #13.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
1 Jul 2008 12:29 AM #18
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
1 Jul 2008 1:27 AM #19
The TableLayout class has the cellCls config. But I would like it to also have cellStyle.
And in the layoutConfig, tableCls and tableStyle.
I usually need to add style="width:100%" to my table layouts.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
1 Jul 2008 1:29 AM #20
Actually, there is tableAttrs in SVN. I'll comment it so that we can see it.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642


Reply With Quote
