[Razor] How to map data between 2 form using Javascript

  1. #1

    [Razor] How to binding girdpanel to a form using Javascript

    I want to map data between 2 form in my Project like this: http://examples2.ext.net/Examples/Gr.../Form_Details/
    But this code is Asp.net, I use MVC3.
    My Grid Panel
    items.Add(Html.X().Panel().Region(Region.East).Width(370).Layout("fit").Title("Control Panel").BodyCls("west-main").Split(true).Collapsible(true)
                             .Items(itemeast =>
                             {//Grid Panel Control Panel Right---------------
                                 itemeast.Add(Html.X().GridPanel().ID("ControlPanelGrid").Title("Device")
                                                                  .Store(store =>
                                                                  {
                                                                      store.Add(Html.X().Store().ID("Storer1")
                                                                                        .AutoLoad(true)
                                                                                        .Model(model => model.Add(Html.X().Model()
                                                                                            .Fields(fields =>
                                                                                            {
                                                                                                fields.Add(Html.X().ModelField().Name("grid-alarm-device-name"));
                                                                                                fields.Add(Html.X().ModelField().Name("grid-check"));
                                                                                                fields.Add(Html.X().ModelField().Name("grid-devidename"));
                                                                                                fields.Add(Html.X().ModelField().Name("grid-lastupdate"));
                                                                                                fields.Add(Html.X().ModelField().Name("grid-status"));
                                                                                                fields.Add(Html.X().ModelField().Name("grid-retry"));
                                                                                            }
                                                                                            )))
                                                                                       .DataSource(dataDevice)
                                                                                      );
                                                                  })
                                                                  
                                                                  .ColumnModel(columnModel =>
                                                                  {
                                                                      columnModel.Columns.Add(Html.X().Column().Text("").ID("ga_id").DataIndex("grid-alarm-device-name").Width(30));
                                                                      columnModel.Columns.Add(Html.X().CheckColumn().TdCls("td-non-img-checkcolum").DataIndex("grid-check").Width(30).Editable(true));
                                                                      columnModel.Columns.Add(Html.X().Column().ID("ga_device_name").Text("Devide Name").DataIndex("grid-devidename"));
                                                                      columnModel.Columns.Add(Html.X().Column().ID("ga_last_update").Text("Latest Update").DataIndex("grid-lastupdate").Width(120));
                                                                      columnModel.Columns.Add(Html.X().Column().ID("ga_status").Text("Status").DataIndex("grid-status"));
                                                                      columnModel.Columns.Add(Html.X().Column().ID("ga_retry").Text("Retry").DataIndex("grid-retry"));
                                                                  })
                                                                .SelectionModel(gaSelectionModel =>
                                                                {
                                                                    gaSelectionModel.Add(Html.X().RowSelectionModel().Listeners(garowlistener =>
                                                                    {
                                                                        garowlistener.Select.Handler = "gaRowSelect();";//Call gaRowSelect in Javascript
                                                                    }));
                                                                })
    This is my Text Fields:
    itemtabpanel.Add(Html.X().Panel().Title("Status").IconPath("/Content/themes/icons/information.png")
                                                                    .Items(itemstatus =>
                                                                        {
                                                                                itemstatus.Add(Html.X().FormPanel().ID("FormPanel").BodyBorder(0).Border(false).Layout("column").Height(290).Items(itemformpanel =>
                                                                                {
                                                                                    itemformpanel.Add(Html.X().Panel().Layout("form").BodyBorder(0).Border(false).Height(290).ColumnWidth(0.65).Items(itempanel1 =>
                                                                                    {
                                                                                        itempanel1.Add(Html.X().Panel().Layout("column").BodyBorder(0).Border(false).Height(150).Items(itemchildpanel01 =>
                                                                                        {
    
                                                                                            itemchildpanel01.Add(Html.X().Panel().BodyBorder(0).Border(false).Height(150).ColumnWidth(0.5).Items(itemchildpan1 =>
                                                                                            {
                                                                                                itemchildpan1.Add(Html.X().Panel().Height(10).BodyBorder(0).Border(false));
                                                                                                itemchildpan1.Add(Html.X().TextField().FieldLabel("Device Name").Name("ga_device_name").ReadOnly(true));
                                                                                                itemchildpan1.Add(Html.X().TextField().FieldLabel("GPS Time").Name("ga_last_update").ReadOnly(true));
                                                                                                itemchildpan1.Add(Html.X().TextField().FieldLabel("Received Time").Name("ga_last_update").ReadOnly(true));
                                                                                                itemchildpan1.Add(Html.X().TextField().FieldLabel("Journey(Km)").ReadOnly(true));
                                                                                            }
                                                                                                    ));
    Last edited by delta; Oct 22, 2012 at 10:04 AM.

Similar Threads

  1. [MVC + Razor] How to load data on the form?
    By Natalie in forum 2.x Help
    Replies: 4
    Last Post: Sep 18, 2012, 11:24 AM
  2. Replies: 2
    Last Post: Jul 10, 2012, 2:23 PM
  3. [CLOSED] [2.0] DataView with Razor Data
    By Timothy in forum 2.x Premium Help
    Replies: 4
    Last Post: Jul 09, 2012, 8:31 PM
  4. [Razor] Populating form values from controller
    By machinableed in forum 2.x Premium Help
    Replies: 2
    Last Post: May 07, 2012, 11:42 AM
  5. Javascript intellisense in Razor not working
    By mpritchard in forum 2.x Help
    Replies: 0
    Last Post: Apr 19, 2012, 10:05 AM

Posting Permissions