DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
224 stars 79 forks source link

Tabs Data Atributtes and HtmlAtributes #352

Closed angelocarlotto closed 9 years ago

angelocarlotto commented 9 years ago

Would be possible to Tabs has Data and HtmlAtributes methods?

@using (var tabs = Html.Bootstrap().Begin(new Tabs("TabId1"))) { @tabs.Tab("Tab One","TabOne",new {@class="testeClassCSS"}).Data(new{idCliente=Model.IdCliente}).Class("TabMainClienteCSSClass") using (Html.BeginForm()) { using (tabs.BeginPanel().Data(new{idCliente=Model.IdCliente}).Class("SubTabClienteCSSClass")) {

    }

}

DmitryEfimenko commented 9 years ago

What kind of html output are you looking for? And why do you need this?

angelocarlotto commented 9 years ago

I have severals tabs, and some of it i need when i click in it, it will make a request into an action and render its contents in the target div. I would like to create something like a component.

in the .cshtml, some thing like @using (var tabs = Html.Bootstrap().Begin(new Tabs())) { @tabs.Tab("Tab One","TabOne").Class("ClickableTabRequest").Data(new{ActionUrl=Url.Action("GetProfile","User"), IdClient=Model.IdCliente}) using (Html.BeginForm()) { using (tabs.BeginPanel()) {

}

}

In the .js file, something like

$(document).on("click",".ClickableTabRequest",function(){ var tab=$(this); $.post(tab.data("actionurl"),tab.data(),function(data){

              $(tab.attr("href")).html(data);
     });

})

Hope i made my self explained.

Thanks

DmitryEfimenko commented 9 years ago

Added requested methods. Please get latest.