Hi, I am kind of new in Kendo UI for Angular 2 and i wish to call a web service when a Tab is selected so i can fetch data to fill in the Tab Contents.
Is there a way to call or invoke a method when a Tab is selected?
3 Answers, 1 is accepted
0
Petyo
Telerik team
answered on 22 May 2017, 08:28 AM
Hello,
yes, you can use the tabSelect event of the TabStrip for that purpose.
Can you please provide a example , basically i wish to display Chart inside each tabs and when a tab is selected , a request is made to the server which provides the data to the charts
0
Petyo
Telerik team
answered on 23 May 2017, 12:32 PM
Hello,
we don't have an example of such kind available, but from what I understand, the Angular rendering mechanism will take care of that for you - especially if you set the `keepTapContent` to false, since the hidden tabs won't be rendered and thus they won't trigger the HTTP service promises.
In case you find this a bit unclear, I may suggest that you exercise the implementation with vanilla angular, using angular's structural directives (ng-for to bind to a given data, and ng-if to hide the container elements).