Hello everyone
I'm new to Ext Js, especially its grid, and it is wonderful library.
Today I have a problem, I have search and read many posts but I don't know why I don't work
I have a grid, and I use pop up add/edit
When the add form popup, I use monitorValid and formBind but the Save button is still enable
Would some one please help me?
Code:
var BookItem = new Ext.FormPanel({
border: false,
frame: true,
labelWidth: 70,
monitorValid: 'true', // !Important
items: [
{
xtype: 'textfield',
name: 'id',
id: 'id',
hidden: true
},
{
xtype: 'textfield',
name: 'book_title',
id: 'book_title',
width: 100,
fieldLabel: 'Book Title',
allowBlank: false
},
{
xtype: 'textfield',
name: 'author',
id: 'author',
width: 100,
fieldLabel: 'Author'
}],
buttonAlign: 'center',
buttons:
[{
align: 'center',
text: 'Save',
handler: Add,
formBind: 'true' // !Important
}, {
align: 'center',
text: 'Cancel',
handler: Cancel
}]
});
Code:
var winForm = new Ext.Window({
title: formTitle,
modal: true,
width: 275,
autoScroll: true,
bodyStyle: 'position:relative;',
monitorResize: true,
constrain: true,
layout: 'fit',
height: ht,
closeAction: 'hide',
layout: 'fit',
items: BookItem
});
Code:
var CreateBookItem = function () {
winForm.update = true;
winForm.setTitle('Create' + " " + formTitle);
BookItem.getForm().reset();
winForm.show();
if (winForm.getHeight() < ht) {
winForm.setHeight(winForm.getHeight() + 32);
}
winForm.center();
};
Any help is highly appreciated
Thank in advance