Feb 10, 2011, 7:41 AM
GridPanel NumberField Editor MaxValue
Hi,
I have below ColumnModel in GridPanel, requirement is data will load from code-behide and we want the NumberField's MaxValue set to the original value. The problem here is I use checkUNIT to setup e.maxValue but the maxValue keeping refresh to Number.MAX_VALUE on next call. Any idea?
Thanks in advance!!
I have below ColumnModel in GridPanel, requirement is data will load from code-behide and we want the NumberField's MaxValue set to the original value. The problem here is I use checkUNIT to setup e.maxValue but the maxValue keeping refresh to Number.MAX_VALUE on next call. Any idea?
Thanks in advance!!
var checkUNIT = function (e) {
//Setup MaxValue
if (e.maxValue == Number.MAX_VALUE) {
e.setMaxValue(e.originalValue);
}
if (e.getValue() > e.maxValue) {
e.setValue(e.maxValue);
Ext.net.Notification.show({
hideFx: {
args: ['l', {}],
fxName: 'ghost'
},
showFx: {
args: ['l', {}],
fxName: 'slideIn'
},
pinEvent: 'click',
alignToCfg: {
offset: [2, 0],
position: 'l-r',
el: Ext.net.getEl('gridUnit')
},
html: 'Data overflow!',
title: 'Title'
});
}
};
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:NumberColumn ColumnID="THU_QUANTITY" DataIndex="THU_QUANTITY" Header="THU_QUANTITY"
Format="0">
<Editor>
<ext:NumberField runat="server" AllowDecimals="false" AllowNegative="false">
<Listeners>
<Change Handler="checkUNIT(this);" />
</Listeners>
</ext:NumberField>
</Editor>
</ext:NumberColumn>
</Columns>
</ColumnModel>