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

MVC helpers generate anchor tags with local href for each tab

1 Answer 106 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Trent
Top achievements
Rank 2
Trent asked on 31 Mar 2014, 06:16 PM
Currently the MVC helpers will generate an anchor tag with a local href for each tab in the tab strip (e.g. #actions-1, #actions-2), and will generate the subsequent id for each content pane. If the tab strip is the first element on the page, this works ok, but if there is content above the tab strip, then when changing tabs the page will scroll until the tabstrip is at the top of the page, and then scroll back down once the new tab has been loaded. This is a bit jarring and only seems to happen when using Internet Explorer. When using plain html and javascript, local hrefs are not generated. Is there a reason they are generated for the MVC helpers, and are they necessary?

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 02 Apr 2014, 03:09 PM
Hello Trent,

Basically the anchor is generated by the MVC wrapper which uses the Html helper to generate links and I am afraid it is not possible to change the rendering behavior.

On which browser does this exactly happen? I tried the offline MVC demos and on Internet Explorer 10 it does not seems to make the browser jump up and down when click on the tabs. Also you can try to prevent the default behavior of any link inside the tabstrip.

e.g.

//when the tabstrip is initialized
 
$("#tabstrip").on("click", ".k-link", function(e){
    e.preventDefault();
})

If possible give a sample project and concrete instructions so we can search for a resolution.

Kind Regards,
Petur Subev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TabStrip
Asked by
Trent
Top achievements
Rank 2
Answers by
Petur Subev
Telerik team
Share this question
or