nopcommerce - How to handle AdminTabStripCreated event and use content from plugin? -


i using nopcommerce 3.40

i handle admintabstripcreated event add new tab plugin.

my code like:

public class admintabstripcreatedeventconsumer : iconsumer<admintabstripcreated>     {         public void handleevent(admintabstripcreated eventmessage)         {  if (eventmessage.tabstripname == "customer-edit")         {          string url="nop.plugin.ui.customertabs.views.test.customeradmin"                 string script = @"<style type=""text/css"">                                 .k-link {                                     font-weight: bold;                                 }                                 </style>                                 <script language=""javascript"" type=""text/javascript"">                                 $(document).ready(function () {                                 var ktabs = $('#customer-edit').data('kendotabstrip');                                 ktabs.append({ text: ""tab name"", contenturl: ""**url**"" });                                 });                                 </script>";                 eventmessage.blockstorender.add(mvchtmlstring.create(script));             }         }      } 

when used script tab created want open custom view page plugin.

please give me idea type of url set in script.

thanks in advance.

regards, jatin

i getting solution.

code like:

 public void handleevent(admintabstripcreated eventmessage)  {    if (eventmessage.tabstripname == "customer-edit")    {  string url = "/controller/action";                 string tabname = "testtab";                 var sb = new stringbuilder();                  sb.append("<script language=\"javascript\" type=\"text/javascript\">");                 sb.append(environment.newline);                 sb.append("$(document).ready(function () {");                 sb.append(environment.newline);                 sb.append("var ktabs = $('#customer-edit').data('kendotabstrip');");                 sb.append(environment.newline);                 sb.append(" ktabs.append({ text: \"" + tabname + "\", contenturl: \"" + url + "\" });");                 sb.append(environment.newline);                 sb.append("});");                 sb.append(environment.newline);                 sb.append("</script>");                 sb.append(environment.newline);                 eventmessage.blockstorender.add(mvchtmlstring.create(sb.tostring()));     }  } 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -