[CLOSED] MVC syntax

  1. #1

    [CLOSED] MVC syntax

    Hi, I try to add tooltip on grid row. Found example:
    <ext:ToolTip
    runat="server"
    Target="={#{GridPanel1}.getView().el}"
    Delegate="={#{GridPanel1}.getView().itemSelector}"
    TrackMouse="true">
    <Listeners>
    <Show Handler="onShow(this, #{GridPanel1});" />
    </Listeners>
    </ext:ToolTip>

    what is syntax to set target if my grid id is "grid" + Model.GridID ?

    ..
     .ToolTips(
                        X.ToolTip()
                            .Target("#{'grid' + Model.GridID}.getView().el")  // this line does not work
    Thanks
    Last edited by Daniil; Sep 16, 2014 at 10:53 AM. Reason: [CLOSED]
  2. #2
    The other issue is where to put the tooptip block. inside viewPort.items?

    [CODE]
    @(
    X.Viewport()
    .Layout(LayoutType.Fit)
    .Items(
    Html.X().GridPanel()
    .ID("gPanel" + Model.GridIDInt) //GridPanel ID
    //.Cls("x-grid-custom")
    .Layout(LayoutType.Anchor)
    .DefaultAnchor("100%")
    .Title("DataEntry -- " + Model.Title)
    .MessageBusListeners(new MessageBusListener
    {
    Name = "Grid." + Model.GridIDInt,
    Handler = "ReLoadGrid(data, this);"
    }
    )
    .Icon(Icon.Table)
    .Frame(true)
    .Store(
    X.Store()
    .ID(Model.GridID)
    .Model(Model.StoreModel)
    .RemotePaging(false)
    .PageSize(20)
    .Proxy(X.AjaxProxy()
    //.API(action =>
    //{
    // action.Read = Url.Action("LoadGridData", "Grid");
    // //action.Sync = "Sync";
    //})
    .Reader(X.JsonReader().Root("data").MessagePropert y("message"))
    .Url(Url.Action("LoadGridData", "Grid"))
    )
    .ShowWarningOnFailure(false)
    .Listeners(events =>
    {
    events.Exception.Fn = "onStoreException";
    })
    .Parameters(new { gridId = Model.GridIDInt })
    )// end store
    .PrepareToolbar(t =>
    {
    t.Handler = "toolbar.items.get(0).setVisible(record.dirty) ;";
    })
    .Listeners(l =>
    {
    l.Command.Handler = "record.reject();";
    })
    )
    .ColumnModel(Model.Columns) //define display columns
    .TopBar(
    X.Toolbar()
    .Items(
    X.Button()
    .Text("Add")
    .Icon(Icon.Add)
    .Handler("onAddRow (this.up('grid'))"),
    X.Button()
    .Text("Delete")
    .ID("btnDelete")
    .Icon(Icon.Delete)
    .Handler("this.up('grid').deleteSelected()"), //if(!this.up('grid').hasSelection()){ #{btnDelete}.disable();}"),

    X.Button()
    .Text("Save All")
    .Icon(Icon.Disk)
    .DirectEvents(de =>
    {
    de.Click.Url = Url.Action("SaveGridDataChanges", "Grid", new { gridID = Model.GridIDInt });
    de.Click.Before = "return ValidateGridData(this.up('grid'))";
    de.Click.Confirmation.ConfirmRequest = true;
    de.Click.Confirmation.Title = "Save ?";
    de.Click.Confirmation.Message = " Are you syre you want to save changes?";
    de.Click.ExtraParams.Add(new Parameter
    {
    Name = "data",
    Value = "this.up('grid').store.getChangedData({skipIdForPh antomRecords : false})",
    Mode = ParameterMode.Raw,
    Encode = true
    });
    de.Click.Success = "onSaveSucess (this.up('grid'))"; //"this.disabled(); this.up('grid').getStore;";
    de.Click.Failure = "onSaveFailure(result)";

    }),
    )//end toolbar items
    )//end toolbar
    .BottomBar(X.PagingToolbar())
    .SelectionModel(
    X.RowSelectionModel()
    .Mode(SelectionMode.Single)

    )
    .View(
    X.GridView()
    .StripeRows(true)
    .LoadingText("Loading Grid Data...")
    .GetRowClass(fn => fn.Fn = "GetRowClass")

    )// end view
    .Listeners(ls =>
    ls.ValidateEdit.Fn = "validateEditor" // this works
    )
    .Plugins(
    X.CellEditing().ClicksToEdit(1)
    )
    .Features(
    X.Grouping()
    .ID("Grouping1")
    .HideGroupedHeader(true)
    .GroupHeaderTplString("{columnName}: {name} ({[values.rows.length]} {[values.rows.length > 1 ? \"Items\" : \"Item\"]})"),
    X.RowWrap(),

    X.Summary().ID("Total" + Model.GridIDInt)
    ),

    // this does not work
    //X.ToolTip ()
    //.Target("#{'gPanel' + Model.GridIDInt}.getView().el}")
    //.Delegate("#{'gPanel' + Model.GridIDInt}.getView().itemSelector}")
    //.TrackMouse(true)
    //.Listeners(ls => ls.Show.Fn = "onShowTop(this, this.up('grid'));")


    ) // end items


    )

Similar Threads

  1. [CLOSED] What's the Razor syntax for InputMask?
    By AmitM in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 26, 2013, 1:31 AM
  2. [ASK] tabPanel.add razor syntax
    By 4L4Y in forum 2.x Help
    Replies: 2
    Last Post: May 21, 2013, 9:29 AM
  3. Syntax to add record to store
    By randallm in forum 2.x Help
    Replies: 1
    Last Post: Apr 10, 2013, 5:46 AM
  4. [CLOSED] autocomplete example with razor syntax ?
    By zwf in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 19, 2012, 3:56 PM
  5. [CLOSED] What is the correct syntax for this?
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Jul 10, 2012, 9:59 PM

Posting Permissions