This is a migrated thread and some comments may be shown as answers.

Block event propagation

2 Answers 170 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Manlio
Top achievements
Rank 1
Manlio asked on 23 May 2017, 08:24 AM

Hello,

There is a way for block a event propagation for a specific time or to wait a specific event?

example:

01.var index = 0;
02. 
03.function OnSelect(e){
04.        index = $(e.item).index();
05.    if(condition){
06.        setTimeout(function(){
07.            OnShow();
08.        },
09.        3000);
10.    }else{
11.        "no wait and run OnShow()....but only when the new url document is ready!";
12.    }
13.}
14. 
15.function OnShow(){
16.    console.log("onShow only after timeout");
17.    switch(index){
18.        case 0:
19.            ViewModelUrl1.someCalc(); // if no document ready --> error!
20.            break;
21.        case 1:
22.            ViewModelUrl2.someCalc(); // if no document ready --> error!
23.            break;
24.    }
25.}
26. 
27.var tabstrip = $("#tabstrip").kendoTabStrip({
28.    animation: {open: {effects: "fadeIn"}},
29.    show: OnShow,
30.    select: OnSelect,
31.    contentUrls: [
32.        'url1',
33.        'url2,
34.    ]
35.}).data('kendoTabStrip');

 

 

Best regards,

Manlio

2 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 24 May 2017, 02:21 PM
Hello Manlio,

You may use e.preventDefault() to stop the progress. E.g. e.preventDefault() on select event would prevent the show, contentLoad and activate events to execute - Dojo sample, based on the TabStrip Events demo.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Manlio
Top achievements
Rank 1
answered on 01 Jun 2017, 01:11 PM

Thank you Dimitar!

 

very simple solution.

Regards,
Manlio

Tags
General Discussions
Asked by
Manlio
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Manlio
Top achievements
Rank 1
Share this question
or