SHARE
TWEET

Untitled

a guest Jun 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @{
  2.                 if (Model != null && Model.Count() > 0)
  3.                 {
  4.                     var grid = new WebGrid(canPage: true, rowsPerPage: 10);
  5.                     grid.Bind(source: Model, rowCount: 0, autoSortAndPage: false);
  6.  
  7.                     <div class="row" id="content2">
  8.                         <div class="col-lg-12 d-flex align-items-stretch">
  9.  
  10.                             @grid.Table(tableStyle: "table table-responsive table-striped table-bordered",
  11.                                 htmlAttributes: new { id = "tableID" },
  12.                                 columns: grid.Columns(
  13.                                 grid.Column(columnName: "A", header: "A", format:@<text><div class="" data-id="@item.KeyA" data-propertyname="KeyA">@item.KeyA</div></text>),
  14.                                 grid.Column("Other", header: "Other", format: @<text>@Html.DropDownList("OtherKey", (IEnumerable<SelectListItem>)ViewBag.OtherKeysList, new { @class = "extra-class" })</text>)))
  15.                         </div>
  16.                         <!--Pagerlist for webgrid-->
  17.                         <div class="col-lg-12 d-flex align-items-stretch">
  18.                             @grid.PagerList(mode: WebGridPagerModes.All, paginationStyle: "pagination pagination-small pagination-right")
  19.                         </div>
  20.  
  21.                         @Html.Hidden("dir", grid.SortDirection)
  22.                         @Html.Hidden("col", grid.SortColumn)
  23.                     </div>
  24.                 }
  25. }
  26.      
  27. <script type="text/javascript">
  28.  
  29.        var dict = [];
  30.  
  31.        $('#btnSubmit').click(function (e) {
  32.            $('#tableID tr').each(function () {
  33.                alert($(this));
  34.                //Obtain row data and and push into "dict"
  35.            });
  36.        });
  37.  
  38. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top