Edit fild in grid panel only if checkbox selected

  1. #1

    Edit fild in grid panel only if checkbox selected

    Hi

    i have gridpanel and checkbox and in this grid panel i have editor

    i want when i selectet the checkbox the field become editable not always

    is it possible???

    this is my gridpanel
     <ext:GridPanel 
                                                    ID="GridPanel1" 
                                                    runat="server" 
                                                    Height="300" 
                                                    Title="Liste des fournisseurs"
                                                    StripeRows="true"
                                                    >
                                                    <Store>
                                                        <ext:Store ID="Store1" runat="server" SerializationMode="Complex"  >
                                                            <Reader>
                                                                <ext:JsonReader IDProperty="FournisseurId">
                                                                    <Fields>
                                                                        <ext:RecordField Name="FournisseurId" />
                                                                        <ext:RecordField Name="FournisseurRaisonSocial" />
                                                                        <ext:RecordField Name="PrixUnitaireProduit" />
                                                                    </Fields>
                                                                </ext:JsonReader>
                                                            </Reader>
                                                        </ext:Store>
                                                    </Store>
                                                    <Listeners>
                                                        <KeyDown Fn="startEditing" />
                                                        <AfterEdit Fn="afterEdit" />
                                                    </Listeners>
                                                    <ColumnModel ID="ColumnModel1" runat="server">
                                                        <Columns>    
                                                            <%--<ext:Column Header="FournisseurId" DataIndex="FournisseurId" Width= "400" />   --%>
                                                            <ext:Column Header="Raison sociale" DataIndex="FournisseurRaisonSocial" Width= "400" />   
                                                            <ext:Column ColumnID="PrixUnitaireProduit" DataIndex="PrixUnitaireProduit" Header="Prix unitaire produit" Width= "400">
                                                            <Editor>
                                                                <ext:TextField  runat="server" />
                                                            </Editor>
                                                            </ext:Column>  
                                                        </Columns>
                                                    </ColumnModel>
                                                    <LoadMask ShowMask="true" />
                                                    <SelectionModel>
                                                     <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" MoveEditorOnEnter="false"   >
                                                     </ext:CheckboxSelectionModel>
                                                    </SelectionModel>
                                                    <LoadMask ShowMask="true" />
                                                     <BottomBar>
                                                         <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10">
                                                            <Items>
                                                                <ext:Label ID="Label2" runat="server" Text="Page size:" />
                                                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                                                    <Items>
                                                                        <ext:ListItem Text="1" />
                                                                        <ext:ListItem Text="2" />
                                                                        <ext:ListItem Text="10" />
                                                                        <ext:ListItem Text="20" />
                                                                    </Items>
                                                                    <SelectedItem Value="10" />
                                                                    <Listeners>
                                                                        <Select Handler="#{PagingToolbar1}.pageSize = parseInt(this.getValue()); #{PagingToolbar1}.doLoad();" />
                                                                    </Listeners>
                                                                </ext:ComboBox>
                                                            </Items>
                                                        </ext:PagingToolbar>
                                                    </BottomBar>
                                                    </ext:GridPanel>
  2. #2
    Hi,

    Please clarify is that the same thread?
    http://forums.ext.net/showthread.php?14916

    If so, please don't duplicate threads in the future.

    Just bump a thread if it leaves non-answered.
  3. #3
    hi Daniil

    yes its the same probleme but i still don't have an anser so can you please help me
  4. #4
    I have remove that duplicated thread.

    Regarding the question.

    Please look at the example.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "test1" },
                    new object[] { "test2" },
                    new object[] { "test3" }
                };
                store.DataBind();
            }
        }
    </script>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel 
                ID="GridPanel1" 
                runat="server" 
                AutoHeight="true" 
                ClicksToEdit="1">
                <Store>
                    <ext:Store runat="server">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="test" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column Header="Test" DataIndex="test" Editable="false">
                            <Editor>
                                <ext:TextField runat="server" />
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:CheckboxSelectionModel runat="server" CheckOnly="true">
                        <Listeners>
                            <RowSelect Handler="this.grid.getColumnModel().setEditable(1, true);" />
                            <RowDeselect Handler="this.grid.getColumnModel().setEditable(1, false);" />
                        </Listeners>
                    </ext:CheckboxSelectionModel>
                </SelectionModel>
            </ext:GridPanel>
        </form>
    </body>
    </html>
  5. #5
    Thx that work fine

Similar Threads

  1. Replies: 1
    Last Post: Mar 11, 2012, 3:03 AM
  2. Replies: 3
    Last Post: Jun 03, 2011, 12:10 PM
  3. Replies: 1
    Last Post: Nov 08, 2010, 9:31 PM
  4. [CLOSED] Date Value is not getting formatted during Edit mode in Grid Panel
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 11, 2010, 7:41 PM
  5. [CLOSED] What the edit type supported by the Grid Panel?
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 01, 2009, 6:50 AM

Posting Permissions