This is a migrated thread and some comments may be shown as answers.

Tooltip not getting data from target span

1 Answer 30 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 15 Feb 2018, 07:23 PM

I have a Tooltip setup to display a grid of data when a span is clicked.  The span has 'data' elements which contain the parameters to be passed to the Action method on the Controller.  This all works pefertly fine in my development environment, however when I deploy to test or production the parameters being passed to the Action method are null.

My implementation follows this example:

https://demos.telerik.com/aspnet-mvc/tooltip/ajax#

When I try the demo at this link, it also does not display the content of the tooltip, just a blank tooltip.

So my question is why does this work for in my development environment but not my test or production environment?  Also, does the example on the demo site not work?

My code is as follows:

.CSHTML content
This is partial content, but enough to show what is setup:

            <div class="row skills-border skills-border-bottom">

                <h3>CMRP <span class="small" style="font-size: .5em">(Click on # for detail)</span></h3>


                <div class="col-md-6 col-lg-6">
                    @{
                        string cmrpValidClass = item.CMRPValidCount == 0 ? "label-danger" : "label-success";
                        string cmrpValidTextClass = item.CMRPValidCount == 0 ? "text-danger": "text-success" ;
                    }
                    <span class="label cmrpDetail @cmrpValidClass" data-group="@item.Category~~true" data-validcmrp="true">@Html.DisplayFor(x => item.CMRPValidCount)</span>

                    <h5 class="@cmrpValidTextClass"> @Html.DisplayNameFor(x => x.CMRPValidCount) </h5>

                </div>

                <div class="col-md-6 col-lg-6">
                    @{
                        string cmrpNotValidClass = item.CMRPNotValidCount == 0 ? "label-success" : "label-danger";
                        string cmrpNotValidTextClass = item.CMRPNotValidCount == 0 ? "text-success" : "text-danger";
                    }
                    <span class="label cmrpDetail @cmrpNotValidClass" data-group="@item.Category~~false" data-validcmrp="false">@Html.DisplayFor(x => item.CMRPNotValidCount)</span>

                    <h5 class="@cmrpNotValidTextClass hasTooltip" title="@cmrpNotValid"> @Html.DisplayNameFor(x => x.CMRPNotValidCount) </h5>

                </div>
            </div>
        </div>
    }
</div>
@(Html.Kendo().Tooltip()
      .For(".cmrpDetail")
      .ShowOn(TooltipShowOnEvent.Click)
      .LoadContentFrom("CMRPDetail", "CenterOfExcellence")
      .Position(TooltipPosition.Top)
      .Width(700)
      .Height(500)
      .Events(events =>
      {
          events.RequestStart("requestStart");
          events.Show("show");
      }))

 

<script>
    function show() {
        this.refresh();
    }
    function requestStart(e) {
        e.options.data = {
            id: e.target.data("group")
        }
    }

</script>

From CenterOfExcellenceController

        public ActionResult CMRPDetail(string id)
        {
            string[] parameters = id.Split(new []{"~~"}, StringSplitOptions.None);

            IEnumerable<CMRPDetailEntity> result = _mPractSkillsBo.GetCMRPDetailByGroup(parameters[0], bool.Parse(parameters[1]));

            return PartialView("CMRPDetail", result);
        }

 

The Routes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");


            routes.MapRoute("Default", "{controller}/{action}/{id}",
                new {controller = "Home", action = "Index", id = UrlParameter.Optional}
                );

            routes.MapRoute(
                "DeleteUser",
                "{controller}/{action}/{id}/{guid}",
                new {controller = "Account", action = "Delete"});

        }

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 19 Feb 2018, 08:56 AM
Hello John,

The problem with the demo is related to a missing view. I have logged it here (https://github.com/telerik/kendo-ui-core/issues/3996) and fixed id. So it will be fixed for the upcoming release. 

This, however, is related to the demo application and as you have the proper partial view on your end, this is not the case on your end. 


In your case, I suggest you to examine why parameters are not passed properly. This might be related to the test and production environment. Maybe there are specific settings to prevent the parameters being transported to the controller. Or maybe a rewrite rule that strips them out. Without being able to properly investigate the exact issue, I am unable to define what might be the exact problem.  Typically, if it works on the development environment and the test and production environments are similar, everything should work fine. Perhaps, you can gather more details by inspecting the requests to the server. 

Regards,
Ianko
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ToolTip
Asked by
John
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or