How add OnClientSelectedIndexChanged of TabPanel by javascript

Posted by: nvd.bka on 8 July 2020, 9:00 pm EST

  • Posted 8 July 2020, 9:00 pm EST

    Hi. When I using TabPanel in ASP.Net MVC. I Try add event
    OnClientSelectedIndexChanged by javascript as :

    var tabInCode = wijmo.Control.getControl('#tabInCode');

    tabInCode.onSelectedIndexChanged(tabDetached_selectedIndexChanged);

    function tabDetached_selectedIndexChanged(s) {
    if (s.selectedTab.header.textContent == 'Chartview') {
    alert(s.selectedTab.header.textContent);
    }

    }



    But it not work. Please help me to do this.

    Many thanks !
  • Replied 9 July 2020, 5:31 pm EST

    Hi,
    The event should be handled using the following code snippet for JS:

    /*
    PureJS code
    */
    var tabInCode = wijmo.Control.getControl('#tabInCode');
    tabInCode.addHandler(tabDetached_selectedIndexChanged);
    function tabDetached_selectedIndexChanged(s,e) {
    if (s.selectedTab.header.textContent == 'Chartview') {
    alert(s.selectedTab.header.textContent);
    }
    }
    /*From MVC*/
    @Html.C1().TabPanel("#tabGettingStarted").OnClientSelectedIndexChanged("tabDetached_selectedIndexChanged")

    Hope it clear!

    Regards,
    Manish Gupta
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels