[CLOSED] create window with GridPanel with codebehind

Page 1 of 3 123 LastLast
  1. #1

    [CLOSED] create window with GridPanel with codebehind

    I'm trying to create window with some fields and grid. When I add GridPanel this stopshowing up. If you remove GridPanel frm here window will show up.

    SVN revision 3464

        protected void ButtonDetails_Click(object sender, DirectEventArgs e)
        {
            Window formWindow = new Ext.Net.Window
            {
                ID = "formWindow",
                Width = 866,
                Height = 500,
                AutoShow = true,
                AutoScroll = true,
                Layout = "Fit",
                Modal = true,
                ButtonAlign = Alignment.Center,
                CloseAction = CloseAction.Close,
                Items = {
                    new Ext.Net.Panel {
                        Title = "Panel Title",
                        Frame = true,
                        Height = 300,
                        Layout = "vbox",
                        AutoScroll = true,
                        LayoutConfig = {
                            new VBoxLayoutConfig {
                                Align = VBoxAlign.Stretch,
                                DefaultMargins = "1 0 1 0"
                            }
                        },
                        Items = {
                            new TextField {
                                DataIndex = "Title",
                                FieldLabel = "Title",
                            },
                            new TextArea {
                                DataIndex = "Description",
                                FieldLabel = "Description",
                            }
                        }
                    },
                    new Ext.Net.GridPanel {
                        StoreID = "HistoryStore",
                        ColumnModel = {
                            Columns = {
                                new Column { ColumnID = "Description", Header = "Description", DataIndex = "Description" }
                            }
                        }
                    }
                }
            };
    
            formWindow.DoLayout();
            formWindow.Render();
            formWindow.Show();
    }
    Last edited by geoffrey.mcgill; Mar 01, 2011 at 3:44 PM. Reason: [CLOSED]
  2. #2
    Hi,

    1. Layout="Fit" allows one child item only therefore grid panel (second item) is not allowed in your case
    2. Calling DoLayout is not required in your case
  3. #3
    I've changed it to vbox but window still not show at all (nothing happened)
  4. #4
    Hi,

    Did you define HistoryStore?
    Here is my test case
    <%@ Page Language="C#" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!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 id="Head1" runat="server">
        <title></title>   
        
        <script runat="server">
            protected void ButtonDetails_Click(object sender, DirectEventArgs e)
            {
                Window formWindow = new Ext.Net.Window
                {
                    ID = "formWindow",
                    Width = 866,
                    Height = 500,
                    AutoShow = true,
                    AutoScroll = true,
                    Layout = "VBox",
                    Modal = true,
                    ButtonAlign = Alignment.Center,
                    CloseAction = CloseAction.Close,
                    LayoutConfig = {
                        new VBoxLayoutConfig {
                            Align = VBoxAlign.Stretch
                        }
                    },
                    Items = {
                        new Ext.Net.Panel {
                            Title = "Panel Title",
                            Frame = true,
                            Height = 300,
                            Layout = "vbox",
                            AutoScroll = true,
                            LayoutConfig = {
                                new VBoxLayoutConfig {
                                    Align = VBoxAlign.Stretch,
                                    DefaultMargins = "1 0 1 0"
                                }
                            },
                            Items = {
                                new TextField {
                                    DataIndex = "Title",
                                    FieldLabel = "Title",
                                },
                                new TextArea {
                                    DataIndex = "Description",
                                    FieldLabel = "Description",
                                }
                            }
                        },
                        new Ext.Net.GridPanel {
                            StoreID = "HistoryStore",
                            Flex=1,
                            ColumnModel = {
                                Columns = {
                                    new Column { ColumnID = "Description", Header = "Description", DataIndex = "Description" }
                                }
                            }
                        }
                    }
                };
         
                formWindow.Render();
                formWindow.Show();
        }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Store ID="HistoryStore" runat="server">
                <Reader>
                    <ext:JsonReader />
                </Reader>
            </ext:Store>
            <ext:Button runat="server" Text="Create window">
                <DirectEvents>
                    <Click OnEvent="ButtonDetails_Click" />
                </DirectEvents>
            </ext:Button>
        </form>
    </body>
    </html>
  5. #5
    strane, I copy you testcase and it not working for me. Window doesn't show up and no error is visible.
    this window is created on button clicked. Store is working because I can see it if I put grid somewhere else than this window. Strange but have no clue what is going on.
  6. #6
    Hi,

    Did you register Ext.Net http module?
    Please monitor http request in FireBug or Fiddler and post response.
    Also you can send your test project (with assemblies) to support email and we will invetigate it
  7. #7
    here is response from POST

    {script:"Ext.net.ResourceMgr.load([{url:\"/AxWebTaskTracker/extnet/extnet-data-js/ext.axd?v=31772\"},{url:\"/AxWebTaskTracker/ux/extensions/debug/Debug-js/ext.axd?v=31772\"},{url:\"/AxWebTaskTracker/ux/extensions/debug/ext/debug-js/ext.axd?v=31772\"},{mode:\"css\",url:\"/AxWebTaskTracker/ux/extensions/debug/ext/css/debug-embedded-css/ext.axd?v=31772\"}], function(){Ext.net.ResourceMgr.destroyCmp(\"formWi ndow\");new Ext.Window({id:\"formWindow\",autoShow:true,render To:Ext.getBody(),autoScroll:true,height:500,width: 866,items:[{autoScroll:true,height:300,items:[{xtype:\"textfield\",fieldLabel:\"Title\",dataInde x:\"Title\"},{xtype:\"textarea\",fieldLabel:\"Desc ription\",dataIndex:\"Description\"}],layoutConfig:{defaultMargins:\"1 0 1 0\",align:\"stretch\"},layout:\"vbox\",frame:true, title:\"Panel Title\"},{xtype:\"netgrid\",flex:1,store:HistorySt ore,selectionMemory:false,cm:this.id3277cc2fae4a42 5b8611c3556039be0a=new Ext.grid.ColumnModel({proxyId:\"\",columns:[{dataIndex:\"Description\",header:\"Description\", id:\"Description\"}]})}],layoutConfig:{align:\"stretch\"},layout:\"vbox\", closeAction:\"close\",buttonAlign:\"center\",hidde n:false,modal:true});});"}
  8. #8
    in addition I have this

           <ext:Store ID="HistoryStore" runat="server">
               <Reader>
                   <ext:JsonReader />
               </Reader>
           </ext:Store>
    but found out that ther is error message

    HistoryStore is not defined
    http://localhost:998/AxWebTaskTracke...xt.axd?v=31772
    Line 277
  9. #9
    Ok so it might be some problem with scope or something because I can't use any object created with tags from here. Generally I don't have this problem anywhere else in my code and I can use everything without problems.
  10. #10
    Hi,

    I see that you use slightly another sample because Debug resources are registered also
    Please provide exactly the same test sample
Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 0
    Last Post: Aug 30, 2011, 3:14 PM
  2. Create GridCommand at codebehind
    By marcelodecon in forum 1.x Help
    Replies: 1
    Last Post: Dec 08, 2010, 1:00 AM
  3. How to create a tab listeners by codebehind mode?
    By GeoffreyRen in forum 1.x Help
    Replies: 1
    Last Post: Jul 30, 2009, 1:44 AM
  4. How to create a window codebehind?
    By snippher in forum 1.x Help
    Replies: 4
    Last Post: Mar 23, 2009, 8:42 PM
  5. [CLOSED] How to create array object in codebehind
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 09, 2008, 6:20 AM

Posting Permissions