JamesC
13 Aug 2009, 11:01 AM
Just finished successful upgrade to 3.0 and thought I'd share a few extensions. This first one is very simple - just gives you a resizable drag bar on the south portion of a fieldset allowing you to increase/decrease it's height. I had a grid inside my fieldset so this allows more/less rows in the grid to be viewed at the same time (grid will auto size if you're using a fit/border layout within your fieldset).
Edit: I have turned this into a plugin, usage - plugins: [new Ext.ux.form.ResizableFieldSet()]
Ext.namespace("Ext.ux.form");
Ext.ux.form.ResizableFieldSet = Ext.extend(Ext.util.Observable, {
init: function(fieldSet) {
// apply resizer to south only (after render)
fieldSet.on("afterrender", function() {
this.resizable = new Ext.Resizable(fieldSet.id, {
handles: "s",
listeners: {
resize: {
fn: function(r, w, h) {
fieldSet.setHeight(h);
}
}
}
});
}, this);
fieldSet.on("collapse", function() {
fieldSet.getEl().setStyle("height", null);
}, this);
}
});
Edit: I have turned this into a plugin, usage - plugins: [new Ext.ux.form.ResizableFieldSet()]
Ext.namespace("Ext.ux.form");
Ext.ux.form.ResizableFieldSet = Ext.extend(Ext.util.Observable, {
init: function(fieldSet) {
// apply resizer to south only (after render)
fieldSet.on("afterrender", function() {
this.resizable = new Ext.Resizable(fieldSet.id, {
handles: "s",
listeners: {
resize: {
fn: function(r, w, h) {
fieldSet.setHeight(h);
}
}
}
});
}, this);
fieldSet.on("collapse", function() {
fieldSet.getEl().setStyle("height", null);
}, this);
}
});