Skip to content

Instantly share code, notes, and snippets.

@javiertoledo
Created March 25, 2010 09:51
Show Gist options
  • Save javiertoledo/343379 to your computer and use it in GitHub Desktop.
Save javiertoledo/343379 to your computer and use it in GitHub Desktop.
ExtJs Auto columns Panel
/* An Ext Panel which distribute items in equally-sized columns that fills all available width */
Ext.ns("Ext.ux");
Ext.ux.AutoColumnPanel = Ext.extend(Ext.Panel, {
layout: 'column',
initComponent: function() {
var columnWidth = 1/this.items.length;
Ext.each(this.items,function(item){
Ext.apply(item,{
columnWidth: columnWidth
});
},this);
Ext.ux.AutoColumnPanel.superclass.initComponent.call(this);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment