Recommended procedure to add tabs in administration pages via plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
Hi,

How to load a view ? Is there not some more strong-typed support?

See also:
https://www.nopcommerce.com/boards/t/32119/product-edit-tabstrip-and-implementation-questions.aspx#133875

J.
7 years ago
curious.
in the 3.80-develop version, this will not work. I try it in the customer-edit and:
when I add a debugger; in the JavaScript, It will render the tab, but none of the tabs have data.
When I have no debugger; command, it has a null reference to $('#customer-edit').data('kendoTabStrip')

any ideas?
(code works fine 3.70)
7 years ago
[email protected] wrote:
curious.
in the 3.80-develop version, this will not work. I try it in the customer-edit and:
when I add a debugger; in the JavaScript, It will render the tab, but none of the tabs have data.
When I have no debugger; command, it has a null reference to $('#customer-edit').data('kendoTabStrip')

any ideas?
(code works fine 3.70)

Version 3.80 doesn't use KendoUI for tabs. Now we use jQuery UI tabs.

Please note that this version is not ready yet. And we'll find (share here) a way to add a new tab from plugins here (work item)
7 years ago
This is what I came up with:


      if (eventMessage.TabStripName == "customer-edit")
      {
        int num = Convert.ToInt32(HttpContext.Current.Request.RequestContext.RouteData.Values["ID"]);
        UrlHelper urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);
        RouteValueDictionary routeValueDictionaries = new RouteValueDictionary()
        {
          { "area", null },
          { "customerId", num }
        };
        string str = urlHelper.Action("myAction", "myController", routeValueDictionaries, HttpContext.Current.Request.Url.Scheme);

                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("<script language=\"javascript\" type=\"text/javascript\">");
                stringBuilder.Append(Environment.NewLine);
                stringBuilder.Append("  $(document).ready(function() ");
        stringBuilder.Append(Environment.NewLine);
                stringBuilder.Append("  {");
                stringBuilder.Append(Environment.NewLine);
                stringBuilder.Append("      $(\"#customer-edit ul\").append( \"<li class='ui-state-default ui-corner-top'><a aria-expanded='true' href='#tab-myTab' data-toggle='tab' data-tab-name='tab-myTab'>Customer Pricing</a></li>\" );");
                stringBuilder.Append(Environment.NewLine);
                stringBuilder.Append("      $(\"#customer-edit\").find(\".tab-content\").append( \"<div id='tab-myTab' class='tab-pane'><div class='panel-group'><div class='panel panel-default'><div class='panel-body' id='loadCSHTMLhere'></div></div></div></div>\");");
                stringBuilder.Append(Environment.NewLine);
                stringBuilder.Append("      $(\"#loadCSHTMLhere\").load('" + str + "');");
                stringBuilder.Append(Environment.NewLine);
                stringBuilder.Append("  });");
                stringBuilder.Append(Environment.NewLine);
                stringBuilder.Append("</script>");
                stringBuilder.Append(Environment.NewLine);

        eventMessage.BlocksToRender.Add(MvcHtmlString.Create(stringBuilder.ToString()));
7 years ago
a.m. wrote:
curious.
in the 3.80-develop version, this will not work. I try it in the customer-edit and:
when I add a debugger; in the JavaScript, It will render the tab, but none of the tabs have data.
When I have no debugger; command, it has a null reference to $('#customer-edit').data('kendoTabStrip')

any ideas?
(code works fine 3.70)
Version 3.80 doesn't use KendoUI for tabs. Now we use jQuery UI tabs.

Please note that this version is not ready yet. And we'll find (share here) a way to add a new tab from plugins here (work item)


Hello Andrew

Hope you have found a way already how to add tab pages in plugins?

Any news?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.