Listeners with MVC3

  1. #1

    Listeners with MVC3

    Hi everybody
    Now I can write with MVC3 like this
    .Listeners(itemlsn =>
                            {
                                itemlsn.ItemClick.Handler = "if (record.data.leaf || record.data.id=='s_root') { e.stopEvent(); loadPage(#{pnlMain}, record); }";
                            })
    but i want to write like this
    item.Add(Html.X().Panel()
                        .Layout(LayoutType.Border)
                        .Region(Region.Center)
                        .Items(itemMain =>
                        {
                            itemMain.Add(Html.X().TabPanel()
                                .Region(Region.Center)
                                .Layout(LayoutType.Border)                            
                                .ID("pnlMain")
                                .TopBar(topBar =>
                                {
                                    topBar.Add(Html.X().Toolbar()
                                        .Flat(true)
                                        .Items(toolBar =>
                                        {
                                            toolBar.Add(new Button { Icon = Icon.PageWord, Text = "Load", Listeners = {How to write????} });
                                            toolBar.Add(new Button { Icon = Icon.PageWhiteWord, Text = "Clean" });
                                            toolBar.Add(new ToolbarSeparator());
                                            toolBar.Add(new Button { Icon = Icon.Accept, Text = "Save", Weight = 200 });
                                            toolBar.Add(new ToolbarFill());
                                            toolBar.Add(new Button { Icon = Icon.Printer, Text = "Print", Weight = 100, X = 100 });
                                        }));
                                }));
                        }));
    when the button click I want submit the form page and my page like this
    @model Test1.Models.WordViewModel
    @{
        Layout = null;
        int i = 0;
    }
    <!DOCTYPE html>
    <html>
    <head>
        <title>Section_root</title>
    </head>
    <body>
        <div>
            <form method="post" target="_self" action="@(Url.Action("SaveData", "Home"))">
            @Html.X().ResourceManager()
            @(Html.X().FormPanel()
                  .ID("s_root")
                  .Items(itemForm =>
                  {
                      itemForm.Add(new TextField
                      {
                          FieldLabel = "title",
                          AnchorHorizontal = "61%",
                          Name = "WBody[" + @i + "].F_VALUE",
                          Value = @Model.WBody[i++].F_VALUE
                      });
                  }))
            </form>
        </div>
    </body>
    </html>
    how to write with Listeners
    give me same sample?
    thanks
    Last edited by zhdl; Jul 09, 2012 at 2:11 AM.

Similar Threads

  1. Ext.net with asp.net or MVC3 ?
    By GKG4 in forum 2.x Help
    Replies: 1
    Last Post: Aug 14, 2012, 4:06 PM
  2. ObjectDataSource and MVC3
    By Therruco in forum 2.x Help
    Replies: 0
    Last Post: May 25, 2012, 3:23 PM
  3. Ext.net library with mvc3
    By Neha in forum 2.x Help
    Replies: 0
    Last Post: May 11, 2012, 9:02 AM
  4. how to load combo box in asp.net MVC3??
    By waqasde in forum 2.x Help
    Replies: 2
    Last Post: Mar 12, 2012, 3:59 PM
  5. Ext.Net with MVC3(Razor)
    By abanikumar in forum 1.x Help
    Replies: 4
    Last Post: Jan 16, 2012, 9:55 AM

Tags for this Thread

Posting Permissions