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

[Solved] How to launch item into an iframe?

3 Answers 94 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pat
Top achievements
Rank 1
Pat asked on 18 Feb 2011, 05:17 AM
I see properties for controllers, actions,and urls.

I was hoping to see some type of "tag" property on the item, and then I was going to hook the client side select event to parse the tag and then depending on settings in the tag either launch into an iframe or a browser modal dialog.

3 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 18 Feb 2011, 07:58 AM
Hello pat,

 You can try setting the target attribute of the panelbar item. Use LinkHtmlAttributes to do that.

items.Add().Text("Foo").LinkHtmlAttributes(new { target = "nameOfTheIframe" });

Regards,
Atanas Korchev
the Telerik team
0
Pat
Top achievements
Rank 1
answered on 18 Feb 2011, 02:32 PM
Thanks, that worked.

Anyway that I can get data into an item so that I can handle the "launching" myself from javascript?

If I handle the ClientSide select event, can I cancel it?

I'm setting the url, target into an item, but I don't really want the item itself to directly launch. I would do that from the handler.

I tried cancelling the event from the handler but the default link behaviour still fires. I added this code and I call it first thing from the select handler:

 

 

function stopEvent(e) {  
    if(!e) e = window.event; 
    if(e.stopPropagation) { 
        e.stopPropagation();
    }  
    else
    { 
         e.cancelBubble =  true
    } 
}

 

0
Atanas Korchev
Telerik team
answered on 18 Feb 2011, 02:34 PM
Hello pat,

 It is not clear how the stopEvent function is used. Also stopping propagation will not prevent the default link behavior - it will cancel DOM event bubbling instead. You should use e.preventDefault().

Greetings,
Atanas Korchev
the Telerik team
Tags
PanelBar
Asked by
Pat
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Pat
Top achievements
Rank 1
Share this question
or