[CLOSED] Problem with dynamic editors in Grid panel (SetEditor)

  1. #1

    [CLOSED] Problem with dynamic editors in Grid panel (SetEditor)

    Dear Team,


    We need to display dynamic editor in one column based on the selection of another column value. Here in the attached example, based on the value of "Mode" column such as Day or Week, the "Name" column display editor as either TextField or DateField respectively. For the initial selection it is showing the correct Editor, but for the subsequent selection in any of the rows, the editors are disappered. We suspect this is because of previous Editor is destroyed when we set the Editor in subsequent selections.


    Please suggest a work around.



    Regards
    Attached Files
    Last edited by Daniil; Apr 15, 2011 at 12:00 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I would suggest you the following way.

    Example
    <ext:Column ColumnID="ciMode" Header="Mode" DataIndex="Mode">
        <Editor>
            <ext:ComboBox ID="cbMode" runat="server">
                <Items>
                    <ext:ListItem Text="Date" Value="Date" />
                    <ext:ListItem Text="Week" Value="Week" />
                </Items>
                <Listeners>
                    <Select Handler="if(this.getValue() === 'Date') {
                                        #{GridPanel1}.colModel.columns[2].setEditor(new Ext.form.DateField());
                                     } else {
                                         #{GridPanel1}.colModel.columns[2].setEditor(new Ext.form.TextField());
                                     }" />
                </Listeners>
            </ext:ComboBox>
        </Editor>
    </ext:Column>
    Also remove <Editor> for 'Name' column and remove BeforeEdit listener.

Similar Threads

  1. [CLOSED] Dynamic grid with Grouping Summary and Editors
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 06, 2011, 4:59 PM
  2. Dynamic grid does not render in a dynamic panel
    By Wellington Caetano in forum 1.x Help
    Replies: 4
    Last Post: Apr 12, 2011, 9:19 PM
  3. [CLOSED] Grid Panel Multi Editors in one column
    By CMA in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Nov 05, 2009, 11:46 AM
  4. Grid Panel Multi Editors in one Column
    By bobs in forum 1.x Help
    Replies: 0
    Last Post: Sep 10, 2009, 5:40 AM
  5. If Value = X Then Disable Grid Editors...?
    By Tbaseflug in forum 1.x Help
    Replies: 4
    Last Post: Jun 11, 2009, 3:06 PM

Posting Permissions