简体   繁体   中英

how to call button click event on click of slice of piechart using highchart

I want to call button click event on click of piechart slice. The button click event is there in code behind page. The button is of type Link Button and href is generating dynamically on it like this

  point: { events: { click: function (event) { $("#m_p1_ButtonApplyFilter").trigger(); } } } 
 <a id="m_p1_ButtonApplyFilter" class="genericButton" href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("m$p1$ButtonApplyFilter", "", true, "MyAnalysis", "", false, true))'>Apply Filters</a> 

And i am calling the button event from my piechart slice that i have writen in the fiddle but unable to call button click event. Kindly suggest me how to call the button event from piechart.I am using highchart.

 point: { events: { click: function (event) { functionForClick(this.name) } } } ....... ....... function functionForClick(obj){ document.getElementById(obj).click(); } 
  <button id="Microsoft Internet Explorer" onclick="alert('Microsoft Internet Explorer was clicked')">Microsoft Internet Explorer </button> 

You can add function functionForClick(this.id); inside the events:{...} .This will call function and click the respective button

Fiddle link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM