vtfuture / BForms

Bootstrap Forms for ASP.NET MVC
MIT License
62 stars 33 forks source link

Is it possible that just using groupeditor tab? #254

Open stantoxt opened 8 years ago

stantoxt commented 8 years ago

Tab is a very common control in development. Sometimes,there are even more than two Grids in one view page , if the tab in BsGroupEditor can be used in BsGrid.

cristipufu commented 8 years ago

BsGroupEditorTabModel is actually a grid, so you could use that with Html.BsGroupEditorFor() to display tabbed grids.

public class BsEditorTabModel<TRow> : IBsEditorTabModel
{
        public BsGridModel<TRow> Grid { get; set; }
}

You have to make a little hack though, hide the plus button.

.bs-addBtn{
    display: none;
}

printscreen

You need to specify your own view partial for rendering the grid row now:

var tab1 = cfg.For(x => x.Developers)
            .Template(x => x.Grid, "_TabItem")
stantoxt commented 8 years ago

That's Great.I am trying it these days.I added field templateGrid like template to allow the renderItems() in BsEditorTabRenderer<TModel,TRow> to RenderModel instead of RenderModel,so that I can use BsGridFor for all items in one view caller not one item in the view one time.Yet , the style bsgrid css can not covers bsgroupeditor css.