Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @{
- if (Model != null && Model.Count() > 0)
- {
- var grid = new WebGrid(canPage: true, rowsPerPage: 10);
- grid.Bind(source: Model, rowCount: 0, autoSortAndPage: false);
- <div class="row" id="content2">
- <div class="col-lg-12 d-flex align-items-stretch">
- @grid.Table(tableStyle: "table table-responsive table-striped table-bordered",
- htmlAttributes: new { id = "tableID" },
- columns: grid.Columns(
- grid.Column(columnName: "A", header: "A", format:@<text><div class="" data-id="@item.KeyA" data-propertyname="KeyA">@item.KeyA</div></text>),
- grid.Column("Other", header: "Other", format: @<text>@Html.DropDownList("OtherKey", (IEnumerable<SelectListItem>)ViewBag.OtherKeysList, new { @class = "extra-class" })</text>)))
- </div>
- <!--Pagerlist for webgrid-->
- <div class="col-lg-12 d-flex align-items-stretch">
- @grid.PagerList(mode: WebGridPagerModes.All, paginationStyle: "pagination pagination-small pagination-right")
- </div>
- @Html.Hidden("dir", grid.SortDirection)
- @Html.Hidden("col", grid.SortColumn)
- </div>
- }
- }
- <script type="text/javascript">
- var dict = [];
- $('#btnSubmit').click(function (e) {
- $('#tableID tr').each(function () {
- alert($(this));
- //Obtain row data and and push into "dict"
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement