[CLOSED] Disable/Enable edit control on gridpanel

  1. #1

    [CLOSED] Disable/Enable edit control on gridpanel

    I have code:
    <ext:GroupingSummaryColumn Header="Specs" DataIndex="SpecsQty" ColumnID="specsFormat" Width="140" SummaryType="Sum">
                                    <SummaryRenderer Handler="return value + ' Sets (Total: ' + value*parseInt(#{hdnSpecsCount}.getValue()) + ' Copies)'" />
                                    <Editor>
                                        <ext:SpinnerField ID="sfspecsFormat" runat="server">
                                             <Listeners>
                                                <Render Handler="this.setDisabled(parseInt(#{hdnSpecsCount}.getValue()) <= 0)"></Render>
                                            </Listeners>
                                        </ext:SpinnerField>
                                    </Editor>
                                </ext:GroupingSummaryColumn>
    It works fine on load, but I looking for event which can fire
    this.setDisabled(parseInt(#{hdnSpecsCount}.getValue()) <= 0)
    for spinner if user change hdnSpecsCount variable.
    Last edited by Daniil; Nov 21, 2011 at 4:07 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    Well, you could handle AfterEditr event of a GridPanel.
    http://docs.sencha.com/ext-js/3-4/#!...vent-afteredit

    Though I'd recommend to stop editing by one of the two following ways:

    1. Returning false from a GridPanel' BeforeEdit handler:
    http://docs.sencha.com/ext-js/3-4/#!...ent-beforeedit

    2. Overriding the ColumnModel's isCellEditable method. Now it looks:
    function (colIndex, rowIndex) {
        var c = this.config[colIndex], ed = c.editable;
        return !!(ed || !Ext.isDefined(ed) && c.editor);
    }
  3. #3
    In the other thread I had saw that you use the EditableGrid plugin. It's an important detail.

    This plugin re-render the editors after any editor blurs. It means that the Render event of a SpinnerField is fired.

    According to the problem in the related thread
    http://forums.ext.net/showthread.php?16252

    this Blur listener for a SpinnerField should help:
    <Spin Handler="this.fireEvent('blur', this);" />
  4. #4
    Thanks. It works.

Similar Threads

  1. Replies: 0
    Last Post: Jul 31, 2012, 5:07 PM
  2. Replies: 1
    Last Post: May 10, 2012, 9:50 PM
  3. [CLOSED] editable gridpanel enable/disable fields
    By schellappa in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 10, 2011, 7:17 PM
  4. Replies: 6
    Last Post: Sep 20, 2010, 2:48 PM
  5. How enable/disable buttons in CommandColumn og gridpanel
    By Satyanarayana murthy in forum 1.x Help
    Replies: 1
    Last Post: Feb 06, 2010, 10:00 AM

Posting Permissions