[CLOSED] How to dispaly N checkbox component within gridpanel ?

  1. #1

    [CLOSED] How to dispaly N checkbox component within gridpanel ?

    Hello,
    How to display N checkbox component [For exemple 4 checkbox] within a gridpanel and how to post their selected values when I click on submit button ?
    PS: I use EXT.NET MVC
    Last edited by Daniil; Mar 19, 2012 at 7:29 PM. Reason: [CLOSED]
  2. #2
  3. #3
    Quote Originally Posted by Daniil View Post
    The Checkbox column does not exist in the database !!! So I can't reproduce column variations sample !
  4. #4
    Quote Originally Posted by Daly_AF View Post
    The Checkbox column does not exist in the database !!! So I can't reproduce column variations sample !
    I'm afraid I don't understand it. Please clarify with more details why you can't use CheckColumn.
  5. #5
    Quote Originally Posted by Daniil View Post
    I'm afraid I don't understand it. Please clarify with more details why you can't use CheckColumn.
    Hi,
    The problem is that database columns which match with gridpanel CheckColumn are defined as nvarchar(1) [Y/N].
    Should I change them as a Bit type ?
  6. #6
    No, you should not, you can achieve the requirement setting up a Respective Convert function of RecordField.

    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[] { "Y" },
                    new object[] { "N" },
                    new object[] { "Y" }
                };
                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">
                <Store>
                    <ext:Store runat="server">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="test">
                                        <Convert Handler="return value === 'Y' ? true : false;" />
                                    </ext:RecordField>
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:CheckColumn Header="Test" DataIndex="test" Editable="true" />
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
        </form>
    </body>
    </html>
  7. #7
    Quote Originally Posted by Daniil View Post
    No, you should not, you can achieve the requirement setting up a Respective Convert function of RecordField.

    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[] { "Y" },
                    new object[] { "N" },
                    new object[] { "Y" }
                };
                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">
                <Store>
                    <ext:Store runat="server">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="test">
                                        <Convert Handler="return value === 'Y' ? true : false;" />
                                    </ext:RecordField>
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:CheckColumn Header="Test" DataIndex="test" Editable="true" />
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
        </form>
    </body>
    </html>
    Great it works, now how to commit selected value changes into database ?
  8. #8

Similar Threads

  1. How to dispaly the Data using calendarpanel
    By krishna in forum 1.x Help
    Replies: 1
    Last Post: Jan 11, 2011, 1:16 PM
  2. Replies: 4
    Last Post: Oct 06, 2010, 9:08 AM
  3. Replies: 1
    Last Post: Aug 13, 2009, 9:37 AM
  4. Controls Dont Dispaly Once Uploaded To Server
    By b.aytes in forum 1.x Help
    Replies: 8
    Last Post: Jul 29, 2009, 10:04 AM
  5. Replies: 3
    Last Post: May 07, 2009, 6:37 AM

Posting Permissions