PDA

View Full Version : {FIX}hoiw do sumit and rest button



fastwings
21 Aug 2009, 2:46 AM
i have this js


//object Builder
FormBuilder.Category.Add = Ext.extend(Ext.FormPanel, {
formTitle: '',
categoryPrimeTbText: '',
categoryComboName: '',
categoryComboNameTitle: '',
categoryComboNameEmptyText: '',
categoryComboFieldText: '',
save: '',
cancel: '',
width: 450,
categorysDS: new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: Config.Xmls[0].GetCategorys
}),
reader: new Ext.data.XmlReader(
{ record: 'Item', id: 'Id' },
[{ name: 'Name' }, { name: 'Id'}]
)
}),
buildComboCategoryList: function() {
this.categorysDS.load();

var combo = new Ext.form.ComboBox({
store: this.categorysDS,
valueField: 'Id',
displayField: 'Name',
//typeAhead: true,
fieldLabel: this.categoryComboName,
title: this.categoryComboNameTitle,
emptyText: this.categoryComboNameEmptyText,
mode: 'local',
forceSelection: true,
width: 270,
triggerAction: 'all'
});
var continer = new Ext.form.FieldSet({
title: this.categoryComboFieldText,
collapsible: true,
autoHeight: true,

autoWidth: true,
defaults: { width: 200 },
defaultType: 'textfield',
items: combo
});
return continer;
},

initComponent: function(config) {
Ext.apply(this, {
//labelWidth: 100, // label settings here cascade unless overridden
url: 'save-form.php',
id: 'formGen',
frame: true,
title: this.formTitle,
width: this.width,
defaults: { width: 350 },
defaultType: 'textfield',

items: [{
fieldLabel: this.categoryPrimeTbText,
name: 'categoryName',
allowBlank: false
}, this.buildComboCategoryList()],
buttons: [{
text: this.save,
handler: function() { }
}, {
text: this.cancel,
handler: function() { getForm().reset(); } }]

});

FormBuilder.Category.Add.superclass.initComponent.apply(this, arguments);
}
});
try add rest and submit btn into at
how i can do at where i can find example that show at like this