PDA

View Full Version : how to validate values in Ext.grid.property.Grid + extjs 4



Ibrahimp
26 Sep 2012, 7:01 AM
hi,
how do i validate my property values before submitting in Ext.grid.property.Grid? below is my grid and store.


propsGrid = Ext.create('Ext.grid.property.Grid', {
id: 'propsGrid',
width: 300,
source: source
});


var propertyStore = Ext.create('Ext.data.Store', {
autoLoad: true, //autoload the data
proxy: {
type: 'ajax',
url: 'ScriptParameter.aspx'
},
fields: ['key', 'value'],
listeners: {
load: {
fn: function (store, records, options) {
// get the property grid component
var propGrid = Ext.getCmp('propsGrid');
// make sure the property grid exists
if (propGrid) {
store.each(function (record) {
source[record.get('key')] = record.get('value');
});
propGrid.setSource(source);

}
}
}
}
});

please suggest.

Thanks

scottmartin
26 Sep 2012, 7:37 AM
Fires after editing, but before the value is set in the record. Return false from event handler to cancel the change.
Have you reviewed the validateedit event?

Scott.

Ibrahimp
26 Sep 2012, 10:55 PM
I want to validate the empty text on value field in Ext.grid.property.Grid on submit click ?