Dynamic ToolTip in MVC

  1. #1

    Dynamic ToolTip in MVC

    I'm able to get a static tooltip to display over my grid, but I would like to make it dynamic to display the data in the cell hovered over. Here is what I have in my view, including the grid I would like it displayed over:

                                                    Html.X().Hidden().ID("hdnDragReqPriorityKey"),
                                                    Html.X().Hidden().ID("hdnNewOrderNumber"),
                                                    Html.X().Hidden().ID("hdnOldOrderNumber"),
                                                    Html.X().GridPanel()
                                                        .Title("Request Priorities")
                                                        .ID("reqPrioritiesGrid")
                                                        .ColumnWidth(1)
                                                        .MarginSpec("0 0 0 0")
                                                        .Flex(1)
                                                        .ToolTips(t => t.Add(Html.X().ToolTip().Target("storeReqPriorities").Width(200).DismissDelay(1500).Html("Here")))
                                                        .Border(true)
                                                        .Store(
                                                            Html.X().Store()
                                                                .ID("storeReqPriorities")
                                                                .AutoLoad(true)
                                                                .DataSource(Model.RequestPriorities)
                                                                .Model(
                                                                    Html.X().Model()
                                                                        .Fields(f =>
                                                                        {
                                                                            f.Add(Html.X().ModelField().Name("RequestPriorityKey").Type(ModelFieldType.Int));
                                                                            f.Add(Html.X().ModelField().Name("RequestPriorityName").Type(ModelFieldType.String));
                                                                            f.Add(Html.X().ModelField().Name("RequestPriorityDescription").Type(ModelFieldType.String));
                                                                            f.Add(Html.X().ModelField().Name("SortOrder").Type(ModelFieldType.Int));
                                                                            f.Add(Html.X().ModelField().Name("ResponseTarget").Type(ModelFieldType.String));
                                                                            f.Add(Html.X().ModelField().Name("ResponseFormat").Type(ModelFieldType.String));
                                                                            f.Add(Html.X().ModelField().Name("ResponseSLA").Type(ModelFieldType.String));
                                                                        })
                                                                )
                                                                .ServerProxy(
                                                                    Html.X().AjaxProxy()
                                                                        .Url(Url.Action("ManageLists_GetRequestPriorities", "Admin", new { area = "Cadence" }))
                                                                )
                                                        )
                                                                .Listeners(l =>
                                                                {
                                                                    l.Select.Handler = "handleReqPopulate(record.data);" + "toggleEditRequest();";
                                                                })
                                                                .ColumnModel(
                                                                    Html.X().Column().Flex(1).Text("Request Priority Name").DataIndex("RequestPriorityName"),
                                                                    Html.X().Column().Flex(3).Text("Request Priority Desciption").DataIndex("RequestPriorityDescription"),
                                                                    Html.X().Column().Flex(1).Text("Sort Order").DataIndex("SortOrder"),
                                                                    Html.X().Column().Flex(1).Text("Response Target").DataIndex("ResponseTarget"),
                                                                    Html.X().Column().Flex(1).Text("Response Format").DataIndex("ResponseFormat"),
                                                                    Html.X().Column().Flex(1).Text("Response SLA").DataIndex("ResponseSLA")
                                                                )
                                                                .SelectionModel(Html.X().RowSelectionModel().Mode(SelectionMode.Single))
                                                                .View(
                                                                    Html.X().GridView()
                                                                        .Plugins(
                                                                            Html.X().GridDragDrop().EnableDrop(true)
                                                                        )
                                                                .Listeners(d => {
                                                                    d.Drop.Fn = "reOrderGrid";
                                                                })
                                                                .DirectEvents(de =>
                                                                {
                                                                    de.Drop.Url = Url.Action("ManageLists_DropData");
                                                                    de.Drop.ExtraParams.Add(new Parameter { Name = "dragReqPriorityKey", Value = "App.hdnDragReqPriorityKey.getValue()", Mode = Ext.Net.ParameterMode.Raw });
                                                                    de.Drop.ExtraParams.Add(new Parameter { Name = "newOrderNumber", Value = "App.hdnNewOrderNumber.getValue()", Mode = Ext.Net.ParameterMode.Raw });
                                                                    de.Drop.ExtraParams.Add(new Parameter { Name = "oldOrderNumber", Value = "App.hdnOldOrderNumber.getValue()", Mode = Ext.Net.ParameterMode.Raw });
                                                                })
                                                                )
    Does something need to be done in the controller?
  2. #2
    Answered on StackOverflow.
    Geoffrey McGill
    Founder & CEO

Similar Threads

  1. Dynamic gridpanel tooltip when row mouse over
    By cchhay in forum 2.x Help
    Replies: 3
    Last Post: Jan 15, 2016, 12:49 PM
  2. [CLOSED] MVC Grid Cell Tooltip
    By JakeM in forum 3.x Premium Help
    Replies: 4
    Last Post: Aug 17, 2015, 5:39 PM
  3. Dynamic Tooltip on Calendar
    By Juls in forum 2.x Help
    Replies: 1
    Last Post: Feb 03, 2015, 3:42 PM
  4. [CLOSED] GridPanel - CommandColumn - dynamic Tooltip
    By jamesand in forum 2.x Premium Help
    Replies: 6
    Last Post: Aug 22, 2013, 5:33 PM
  5. Replies: 1
    Last Post: Apr 25, 2013, 7:02 AM

Tags for this Thread

Posting Permissions