Skip to content

3.2.0

Compare
Choose a tag to compare
@ekondur ekondur released this 04 Jan 13:32
688a8e7

Default Order:

.Orders(order => {
    order.Add(p => p.Name, OrderBy.Descending);
    order.Add(p => p.Age, OrderBy.Ascending);
})

Using this method you can define which column(s) the order is performed upon, and the ordering direction. Reference

Using Tag Helper:

<orders>
        <add field="Name" order-by="Descending" />
</orders>

Length Menu:

.LengthMenu(new int[] {5,10,15})

This method allows you to readily specify the entries in the length drop down select list that DataTables shows . Reference

.LengthMenu(new int[] {5,10,15}, true)

Set hasAll paramter true to show All option in select.

.LengthMenu(new int[] {5,10,15}, true, "All Pages")

Set allText paramter to change name of option All.

Using Tag Helper:

<length-menu values="new int[]{5,10,15}" has-all="true" all-text="All Pages"/>

Page Length:

.PageLength(15)

Number of rows to display on a single page when using pagination. Reference

Using Tag Helper:

<data-source page-length="20"/>