[CLOSED] CheckboxSelectionModel Enabled=false does not work

  1. #1

    [CLOSED] CheckboxSelectionModel Enabled=false does not work

    Hi,

    the subject already describes my problem.

    Is it right, that Enabled=false for the CheckboxSelectionModel does not work?

    In my application I only want that specific users can check rows of my grid.

    Is this a bug?

    And is there a known workaround?


    Regards,

    Martin
  2. #2

    RE: [CLOSED] CheckboxSelectionModel Enabled=false does not work

    Hi,

    SelectionModel doesn't support Enabled/Disabled functionality (this property is inherited from ASP.NET WebControl).
    I think you need to check user in Page_Load and add appropriate SelectionModel for him (by default the CellSelectionModel is using)
  3. #3

    RE: [CLOSED] CheckboxSelectionModel Enabled=false does not work

    Hi,

    do you mean that I should add the CheckboxSelectionModel in code behind?

    For example like this:

    
      if (isAdmin)
    
                {
    
                    CheckboxSelectionModel cbSelModel = new CheckboxSelectionModel();
    
                    cbSelModel.ID = "CheckboxSelectionModel1";
    
                    cbSelModel.CheckOnly = true;
    
                    cbSelModel.Listeners.RowSelect.Handler =
    "if(#{ComboBox1}.disabled==true) {  #{ComboBox1}.enable();
    #{ButtonMove}.enable();}";
    
                    cbSelModel.HideCheckAll = true;
    
    
    
                    GridPanel1.SelectionModel.Add(cbSelModel);
    
                }
    This does not really work.


    Here is a full example (if i comment out everything between if(isAdmin)... then it works fine):

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GridBugTestpage.aspx.cs"
        Inherits="etask.App.DEV.MP.GridBugTestpage" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Ext.IsAjaxRequest)
            {
                this.Store1.DataSource = new object[]
                {
                    new object[] {"http://www.ext.net", 71.72, 0.02, 0.03},
                    new object[] {"http://www.extjs.com", 29.01, 0.42, 1.47},
                    new object[] {"http://www.spiegel.de", 83.81, 0.28, 0.34},
                     new object[] {"http://www.ext.net", 71.72, 0.02, 0.03},
                    new object[] {"http://www.extjs.com", 29.01, 0.42, 1.47},
                    new object[] {"http://www.spiegel.de", 83.81, 0.28, 0.34},
                     new object[] {"http://www.ext.net", 71.72, 0.02, 0.03},
                    new object[] {"http://www.extjs.com", 29.01, 0.42, 1.47},
                    new object[] {"http://www.spiegel.de", 83.81, 0.28, 0.34},
                };
    
                bool isAdmin = true; // TEST!!!!
    
                if (isAdmin)
                {
                    CheckboxSelectionModel cbSelModel = new CheckboxSelectionModel();
                    cbSelModel.ID = "CheckboxSelectionModel1";
                    cbSelModel.CheckOnly = true;
                    cbSelModel.Listeners.RowSelect.Handler = "if(#{ComboBox1}.disabled==true) {  #{ComboBox1}.enable(); #{ButtonMove}.enable();}";
                    cbSelModel.HideCheckAll = true;
    
                    GridPanel1.SelectionModel.Add(cbSelModel);
                }
    
                this.Store1.DataBind();
            }
    
    
    
        }
    
        protected void MoveSelection(object sender, AjaxEventArgs e)
        {
    
    
    
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Basic Row Command - Coolite Toolkit Examples</title>
        <link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ScriptManager ID="ScriptManager1" runat="server" Theme="Gray" />
        <ext:Store ID="Store1" runat="server" GroupField="text1">
            <Reader>
                <ext:ArrayReader>
                    <Fields>
                        <ext:RecordField Name="company" />
                        <ext:RecordField Name="price" />
                        <ext:RecordField Name="text1" />
                        <ext:RecordField Name="text2" />
                    </Fields>
                </ext:ArrayReader>
            </Reader>
        </ext:Store>
        <ext:ViewPort ID="ViewPort1" runat="server">
            <Body>
                <ext:FitLayout runat="server" ID="FitLayoutGridPanel1">
                    <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" Title="Cell commands"
                        AutoExpandColumn="Company" MonitorResize="true" MonitorWindowResize="true">
                        <ColumnModel ID="ColumnModel1" runat="server">
                            <Columns>
                                <ext:Column ColumnID="Company" Header="Company" Width="160" Sortable="true" DataIndex="company" />
                                <ext:Column Header="Price" Width="100" Sortable="true" DataIndex="price" Align="Right" />
                                <ext:Column Header="text2" Width="100" Sortable="true" DataIndex="text1" Align="Right" />
                                <ext:Column Header="text2" Width="100" Sortable="true" DataIndex="text2" Align="Right" />
                            </Columns>
                        </ColumnModel>
                        <LoadMask ShowMask="true" />
                        <TopBar>
                            <ext:Toolbar runat="server" ID="Toolbar1">
                                <Items>
                                    <ext:ComboBox ID="ComboBox1" runat="server" Enabled="false">
                                        <Items>
                                            <ext:ListItem Text="Text1" Value="1" />
                                            <ext:ListItem Text="Text2" Value="2" />
                                            <ext:ListItem Text="Text3" Value="3" />
                                            <ext:ListItem Text="Text4" Value="4" />
                                        </Items>
                                    </ext:ComboBox>
                                    <ext:ToolbarButton ID="ButtonMove" StandOut="true" runat="server" Text="Umlagern"
                                        Enabled="false">
                                        <AjaxEvents>
                                            <Click Type="Submit" OnEvent="MoveSelection" />
                                        </AjaxEvents>
                                    </ext:ToolbarButton>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <View>
                            <ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true" ShowGroupName="true"
                                EnableNoGroups="true" HideGroupedColumn="true" StartCollapsed="true" />
                        </View>
                        <Listeners>
                            <Command Handler="Ext.Msg.alert('<%=LgCenterPanel.ClientID%>', 'Command = '+ command + '<br/>'+ 'Column = ' + this.getColumnModel().getDataIndex(colIndex));" />
                        </Listeners>
                    </ext:GridPanel>
                </ext:FitLayout>
            </Body>
        </ext:ViewPort>
        </form>
    </body>
    </html>

    Regards,

    Martin
  4. #4

    RE: [CLOSED] CheckboxSelectionModel Enabled=false does not work

    Hi,

    Yes, it is a bug. Please update from SVN
  5. #5

    RE: [CLOSED] CheckboxSelectionModel Enabled=false does not work

    Hi,


    yes now it works. Thanks!


    Bye,
    Martin

Similar Threads

  1. [CLOSED] Enabled = false in 0.8.2
    By macap in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 14, 2010, 8:40 AM
  2. [CLOSED] Disabled Checkbox is always false and shows enabled true.
    By Sharon in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 12, 2009, 4:10 AM
  3. [CLOSED] Combo Enabled = False in CardLayout ?Bug?
    By CMA in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 18, 2009, 12:58 PM
  4. Replies: 1
    Last Post: May 22, 2009, 7:38 AM
  5. Replies: 2
    Last Post: Mar 29, 2009, 3:20 PM

Posting Permissions