Question

I have a Ext.grid.Panel with Ext.grid.plugin.RowEditing plugin.

It's working fine, but I need to limit the size of 2 string fields to avoid insert/update exceptions coming from DB.

I have tried maxLength property in Grid column and validations: [ {type: 'length', field: 'no_fornecedor', max: 49} ] in the Ext.data.Model. But none worked, ExtJS still lets user type as many text as he wants and update with no warning.

Was it helpful?

Solution

Got it!

In the column we must add the following editor property:

{
    header: 'name',
    dataIndex: 'id',
    flex: 1,
    editor: {
        allowBlank: false,
        maxLength: 49
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top