[CLOSED] GridPanel NumberField MaxValue

  1. #1

    [CLOSED] GridPanel NumberField MaxValue

    Hi,

    Does anyone have any suggestions on the [best] way to set the MaxVal of a NumberField to that of the row value of another column in the store/GridPanel? This would potentially result in each row's NumberField having a different MaxVal.

    I've been looking at the validator function and the focus event of the NumberField but it would appear that it's going to be quite convoluted as you don't have the row data provided.

    Ben

    <ext:Column DataIndex="Qty" Header="Quantity" Align="Right" Hideable="false" Width="80" />
    <ext:Column DataIndex="Dispensed" Header="Dispensed" Sortable="false" MenuDisabled="true" Width="80" Align="Right" Hideable="false">
       <Editor>
          <ext:NumberField runat="server" ID="AmountDispensed" AllowBlank="true" AllowDecimals="true" BlankText="0" DecimalPrecision="3" Width="50" Stateful="false" />
       </Editor>
    </ext:Column>
  2. #2

    RE: [CLOSED] GridPanel NumberField MaxValue

    Hi,

    I think you need use ValidateEdit event of GridPanel


    validateedit : ( Object e )
    Fires after a cell is edited, but before the value is set in the record. Return false to cancel the change. The edit event object has the following properties
    grid - This grid
    record - The record being edited
    field - The field name being edited
    value - The value being set
    originalValue - The original value for the field, before the edit.
    row - The grid row index
    column - The grid column index
    cancel - Set this to true to cancel the edit or return false from your handler.
    Listeners will be called with the following arguments:
    e : Object
    An edit event (see above for description)

Similar Threads

  1. Replies: 1
    Last Post: Apr 06, 2011, 12:32 PM
  2. GridPanel NumberField Editor MaxValue
    By vincent_van in forum 1.x Help
    Replies: 0
    Last Post: Feb 10, 2011, 7:41 AM
  3. [CLOSED] DateField MaxValue
    By ogokgol in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 17, 2011, 3:19 PM
  4. [CLOSED] Set MaxValue TextField
    By pdcase in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 23, 2010, 8:11 AM
  5. [CLOSED] TimeField minValue maxValue
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 14, 2009, 6:20 AM

Posting Permissions