[CLOSED] Cellediting Text toUpperCase after edit with keypress enter

  1. #1

    [CLOSED] Cellediting Text toUpperCase after edit with keypress enter

    Hi, I want to change all texts to UpperCase but when I do double click and edit my text with lowercase and after I press the key "enter" this is not working but, when I do click in other place this is working, Can I help me with convert to UpperCase when I press the key enter to finish cell edit?

    
            protected void Page_Load(object sender, EventArgs e)
            {
                List<GrupoMenu> lGrupoMenu = new List<GrupoMenu>();
                for (int i = 0; i <= 5; i++)
                {
                    GrupoMenu oGrupoMenu = new GrupoMenu();
                    oGrupoMenu.ID = "id" + i;
                    oGrupoMenu.Descripcion = "descripci?n" + i;
                    lGrupoMenu.Add(oGrupoMenu);
                }
    
                sGruposMenu.DataSource = lGrupoMenu;
                sGruposMenu.DataBind();
            }
    
            public class GrupoMenu
            {
                public string ID
                {
                    get;
                    set;
                }
    
                public string Descripcion
                {
                    get;
                    set;
                }
            }
    
            <ext:GridPanel
                ID="gpGruposMenu"
                runat="server"
                Height="420"
                Width="960"
                Title="GRUPOS MEN?"
                EnableColumnHide="false"
                EnableColumnMove="false"
                Header="true"
                TitleAlign="Left">
                <Store>
                    <ext:Store
                        ID="sGruposMenu"
                        runat="server">
                        <Model>
                            <ext:Model ID="mGruposMenu" runat="server">
                                <Fields>
                                    <ext:ModelField Name="ID" Type="String" />
                                    <ext:ModelField Name="Descripcion" Type="String" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel>
                    <Columns>
                        <ext:Column 
                            ID="cID"
                            runat="server"
                            Text="ID"
                            Align="Center"
                            Width="100"
                            DataIndex="ID">
                            <Editor>
                                <ext:TextField
                                    ID="txtID"
                                    runat="server"
                                    MaxLength="3"
                                    EnforceMaxLength="true">
                                    <Listeners>
                                        <Blur Handler="App.txtID.setValue(App.txtID.getValue().toUpperCase());" />
                                    </Listeners>
                                </ext:TextField>
                            </Editor>
                        </ext:Column>
                        <ext:Column
                            ID="cDescripcion"
                            runat="server"
                            Text="DESCRIPCI?N"
                            Align="Left"
                            Width="858"
                            DataIndex="Descripcion">
                            <Editor>
                                <ext:TextField
                                    ID="txtDescripcion"
                                    runat="server"
                                    MaxLength="50"
                                    EnforceMaxLength="true">
                                    <Listeners>
                                        <Blur Handler="App.txtDescripcion.setValue(App.txtDescripcion.getValue().toUpperCase());" />
                                    </Listeners>
                                </ext:TextField>
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <View>
                    <ext:GridView
                        ID="gvGruposMenu"
                        runat="server"
                        StripeRows="true"
                        AllowDeselect="true">
                    </ext:GridView>
                </View>
                <Plugins>
                    <ext:CellEditing ID="ceGruposMenu" runat="server" ClicksToEdit="2">
                        <Listeners>
                            <BeforeEdit Handler="console.log('before edit');" />
                            <Edit Handler="console.log('before edit');" />
                            <ValidateEdit Handler="console.log('before edit');"  />
                        </Listeners>
                    </ext:CellEditing>
                </Plugins>
                <SelectionModel>
                    <ext:RowSelectionModel
                        ID="rsmGruposMenu"
                        runat="server"
                        AllowDeselect="true">
                    </ext:RowSelectionModel>
                </SelectionModel>
            </ext:GridPanel>
    Regards
    Last edited by Daniil; Nov 13, 2014 at 6:51 AM. Reason: [CLOSED]
  2. #2
    Hi @osef,

    Please try this.
    <ext:CellEditing ...>
        <Listeners>
            <BeforeEdit Handler="e.value = e.value.toLowerCase();" />
            <Edit Handler="e.record.set(e.field, e.value.toUpperCase());" />
        </Listeners>
    </ext:CellEditing>
    Is this working as you need?

    When testing, please remove the Blur listeners.
  3. #3
    This is working Daniil, thank you.

Similar Threads

  1. Replies: 5
    Last Post: Sep 20, 2017, 12:23 AM
  2. How to capture ENTER keypress in HTMLEditor?
    By mahyar in forum 1.x Help
    Replies: 0
    Last Post: Mar 30, 2010, 7:56 AM
  3. [CLOSED] Handle enter keypress on gridpanel
    By jchau in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 23, 2010, 4:38 PM
  4. ENTER KeyCapture Keypress
    By Juls in forum 1.x Help
    Replies: 1
    Last Post: Nov 04, 2009, 9:19 AM
  5. KeyPress KeyCapture ENTER
    By Juls in forum 1.x Help
    Replies: 1
    Last Post: Jun 23, 2009, 9:22 PM

Tags for this Thread

Posting Permissions