Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you looked into jQuery Datatables <a href="http://www.datatables.net/" rel="nofollow">http://www.datatables.net/</a></p> <p>I recently migrated from MVCContrib Grid to jQuery Datatables. They are pretty awesome.</p> <p>Here is how we initialize the table.</p> <pre><code>BindTable: function () { var that = this; this.Table = $('#sorting-advanced'); var tableStyled = false; this.Table.dataTable({ 'aoColumnDefs': [ { 'aTargets': [1], 'sType': 'num-html' }, { 'aTargets': [3], 'sType': 'currency' }, { 'aTargets': [5], 'bSortable': false, } ], 'sPaginationType': 'full_numbers', 'sDom': '&lt;"dataTables_header"lfr&gt;t&lt;"dataTables_footer"ip&gt;', 'fnDrawCallback': function (oSettings) { // Only run once if (!tableStyled) { that.Table.closest('.dataTables_wrapper').find('.dataTables_length select').addClass('select').styleSelect(); tableStyled = true; } } }); }, </code></pre> <p>Here is the Razor View</p> <pre><code> &lt;table class="table responsive-table" id="sorting-advanced"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th scope="col"&gt;Date&lt;/th&gt; &lt;th scope="col"&gt;Document #&lt;/th&gt; &lt;th scope="col"&gt;Tenant&lt;/th&gt; &lt;th scope="col"&gt;Amount&lt;/th&gt; &lt;th scope="col" class="align-center"&gt;Reconciled&lt;/th&gt; &lt;th scope="col" class="align-center"&gt;Actions&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; @foreach (var item in Model.Items) { &lt;tr&gt; &lt;td&gt;@item.Date.ToShortDateString()&lt;/td&gt; &lt;td&gt; &lt;a href="@Url.Action("Edit", new {id = item.Id})"&gt;@item.Number&lt;/a&gt; &lt;/td&gt; &lt;td&gt;@item.Contact.DisplayName&lt;/td&gt; &lt;td&gt;@item.Amount.ToString("C2")&lt;/td&gt; &lt;td class="align-center"&gt; @Html.CheckBoxFor(x =&gt; item.Reconciled, new {id = item.Id}) &lt;/td&gt; &lt;td class="align-center vertical-center"&gt; &lt;span class="button-group compact"&gt; &lt;a href="@Url.Action("Edit", new {id = item.Id})" class="button icon-pencil with-tooltip" title="Edit Payment"&gt;&lt;/a&gt; &lt;a href="#" id="@item.Id" class="button icon-trash with-tooltip confirm-delete" title="Delete Payment"&gt;&lt;/a&gt; &lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; } &lt;/tbody&gt; &lt;/table&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload