[CLOSED] Cancel editor

  1. #1

    [CLOSED] Cancel editor

    I have an editor for a column in a grid

    
    <ext:Column DataIndex="WIWeight" Header="What-If" Width="70" Align="Center" ColumnID="WIWeight"
                                                Sortable="false">
                                                <Editor>
                                                    <ext:TextField  ID="WIWeightEditor" runat="server" MaskRe="/[0-9\.\-]/">
                                                        <Listeners>
                                                            <Render fn="editorRender"  />
                                                        </Listeners>
                                                    </ext:TextField>
                                                </Editor>
                                                <EditorOptions>
                                                    <Listeners>
                                                        <Complete Handler="UpdateTotal()" Buffer="20" />
                                                    </Listeners>
                                                </EditorOptions>
                                                <Renderer Fn="gridRender" />
                                            </ext:Column>

    I have a rendered that "disables" the editor based on certain criteria...


    var editorRender = function editorRender(item) {
        //set index based on id.
    
    
        (item.id.indexOf('Weight1') > -1) ? colIndex = 2 : (item.id.indexOf('Weight2') > -1) ? colIndex = 3 : colIndex = 4;
        if ((hidPortType.getValue() == "Actual") || (hidPortType.getValue() == "Manual"))
            this.setDisabled(true);
        else if ((hidPortWeightType.getValue() == 'NoRebalanceBeginning') && (colIndex == 2))
            this.setDisabled(true);
        else if ((hidPortWeightType.getValue() == 'NoRebalanceEnding') && (colIndex == 3)) {
         
            this.setDisabled(true);
        }
        // gridFund.getColumnModel().columns[whatIfIndex]
    }
    Is there any other way to "disable" the editor? Ideally, I'd like to either popup a message saying this isn't editable, or, cancel the event all together because right now the disables looks terrible.
    Last edited by Daniil; Jun 27, 2011 at 12:53 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use BeforeEdit event of GridPanel (also, use AfterEdit event instead Complete event of Editor)
    http://dev.sencha.com/deploy/ext-3.3...idPanel-events

Similar Threads

  1. [CLOSED] Cancel TreePanel editing
    By RCN in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Jun 26, 2012, 8:19 PM
  2. [CLOSED] Cannot cancel tab close in TabPanel
    By Fredrik in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 14, 2012, 12:58 PM
  3. [CLOSED] Cancel cellclick on certain column
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 13, 2011, 8:04 AM
  4. [CLOSED] Can I cancel out of a contextMenu
    By mattwoberts in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 24, 2011, 8:44 AM
  5. Cancel RowSelection
    By rthiney in forum 1.x Help
    Replies: 0
    Last Post: Oct 12, 2009, 4:28 PM

Posting Permissions