[CLOSED] disabled Gridpanel

  1. #1

    [CLOSED] disabled Gridpanel

    Currently, when a gridpanel is disabled, the data in the grid is so light that is not readable.is there a way to apply CSS to a disabled gridpanel? is there a css example that i can use. Thanks for your help
    Last edited by Daniil; Dec 19, 2011 at 6:18 AM. Reason: [CLOSED]
  2. #2
    Hi,

    A disabled panel is masked to get disabled functionality.

    Well, please clarify what would you want from a disabled GridPanel, what functionality?
  3. #3
    Thanks for your reply.
    I have a editable grid panel, which is disabled as default so most user only have read only access. User who has edit permission can click on admin edit button to enable the grid for edit.

    The issue is when the grid is disabled. it is hard to read. I am wondering if there is a way i can make this grid readable
    should i disable each row to be none clickable with a light gray background?
    or apply css to the gridpanel to make the text bold,bigger fonter or red color?
    not sure css route is possible, if not, if disable editable row possible?
  4. #4
    I recommend to use the GridPanel's BeforeEdit to allow/disallow editing.

    Please see the BeforeEdit listener, the CustomConfig section and the Toggle button in the following 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">
                            <Editor>
                                <ext:TextField runat="server" />
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <CustomConfig>
                    <ext:ConfigItem Name="lockEditing" Value="false" Mode="Raw" />
                </CustomConfig>
                <Listeners>
                    <BeforeEdit Handler="return this.lockEditing;" />
                </Listeners>
            </ext:GridPanel>
            <ext:Button runat="server" Text="Toggle">
                <Listeners>
                    <Click Handler="GridPanel1.lockEditing = !GridPanel1.lockEditing;" />
                </Listeners>
            </ext:Button>
        </form>
    </body>
    </html>
    See also
    http://docs.sencha.com/ext-js/3-4/#!...ent-beforeedit

Similar Threads

  1. Gridpanel Next Page Disabled in CompositeField??
    By healingnations in forum 1.x Help
    Replies: 1
    Last Post: Jul 03, 2012, 3:37 PM
  2. [CLOSED] GridPanel Filter Become Disabled as Default
    By Sevilay Tanış in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 09, 2012, 9:12 AM
  3. [CLOSED] Disabled Sorting in GridPanel
    By csharpdev in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 22, 2010, 1:22 PM
  4. Replies: 0
    Last Post: Nov 14, 2010, 1:55 AM
  5. [CLOSED] Sorting Disabled in GridPanel
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 07, 2010, 11:37 AM

Posting Permissions