[CLOSED] Check all and Uncheck all with GridPanel with RowExpander Plugin

  1. #1

    [CLOSED] Check all and Uncheck all with GridPanel with RowExpander Plugin

    Hello,

    Using this example: https://examples1.ext.net/#/GridPane...ic_GridPanels/

    I created "nested" gridpanels.


    Now I added Checkbox colums to both "parent" and dynamic "child" gridpanels.


    Any idea how to add Checkall and Uncheckall functionality to this?


    Actually I am more interested in a client side case (for already loaded - cached child grid) since for the server side it looks easy to send another parm (checked/unchecked) to "BeforeExpand" DirectEvent.


    Thanks.
    Last edited by Daniil; Dec 17, 2010 at 1:26 PM. Reason: [CLOSED]
  2. #2
    Quote Originally Posted by deejayns View Post
    Now I added Checkbox colums to both "parent" and dynamic "child" gridpanels.
    Hi,

    Please clarify do you mean <ext:CheckColumn>?

    Quote Originally Posted by deejayns View Post
    Any idea how to add Checkall and Uncheckall functionality to this?
    How should this look? Like functionality of CheckboxSelectionModel?

    Quote Originally Posted by deejayns View Post
    Actually I am more interested in a client side case (for already loaded - cached child grid) since for the server side it looks easy to send another parm (checked/unchecked) to "BeforeExpand" DirectEvent.
    I'm not sure what you mean. Could you clarify?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Please clarify do you mean <ext:CheckColumn>?

    Correct.

    How should this look? Like functionality of CheckboxSelectionModel?
    Yes.


    I'm not sure what you mean. Could you clarify?
    I mean if the child grid has not been generated yet I can send its parent's state (checked or unchecked) and generate the child grid according that.

    On the other hand if child grid is generated and cached I need to keep it in sync with the parent.

    Or maybe I can have CheckBoxSelectionModel ,with the check all, remove all hidden, for the child and wire it up with the parent's actions.

    Does that make sense?

    Thanks.
  4. #4
    Hi,

    Maybe something like this?

    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[] { true, "test12", "test13" },
                    new object[] { false, "test22", "test23" },
                    new object[] { true, "test32", "test33" }
                };
                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>
    
        <script type="text/javascript">
            var myHandler = function(e, field) {
                var checked = Ext.fly(field).getAttribute("checked");
                GridPanel1.getStore().each(function(record) {
                    record.data["test1"] = checked;
                });
                GridPanel1.getView().refresh();
            }
        </script>
    </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="test1" />
                                <ext:RecordField Name="test2" />
                                <ext:RecordField Name="test3" />
                            </Fields>
                        </ext:ArrayReader>
                    </Reader>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:CheckColumn 
                        Header="<input id ='myId' type='checkbox' />"
                        DataIndex="test1" 
                        Sortable="false" 
                        Align="Center" 
                        Width="30" 
                        MenuDisabled="true" />
                    <ext:Column Header="Test2" DataIndex="test2" />
                    <ext:Column Header="Test3" DataIndex="test3" />
                </Columns>
            </ColumnModel>
            <Listeners>
                <ViewReady Handler="Ext.get('myId').on('click', myHandler);" />
            </Listeners>
        </ext:GridPanel>
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] Check Uncheck Radio using javascript
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 21, 2011, 10:45 AM
  2. [CLOSED] Check and uncheck all checkboxes treepanel
    By CarWise in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 11, 2010, 10:50 AM
  3. [CLOSED] Check/Uncheck a treenode
    By macap in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 06, 2010, 9:12 AM
  4. Replies: 1
    Last Post: Aug 13, 2009, 9:37 AM
  5. [CLOSED] GridPanel RowExpander Plugin
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 12, 2008, 7:10 PM

Tags for this Thread

Posting Permissions