datatables

DataTable Ajax Server Side Loading

Instead of Loading all items at once in clientside, we may require to load data partially with pagination for better loading. scenario: when we have 1000s of data in table and we are showing them without filtration Simple use Datatable Serverside Loading Changes in Controller side: For Client Side:

Help Doc For Dynamic ShowHideColumns Related to DataTables

Snippet Sample HTMl Snippet <div class=”dropdown showHideColumns” data-target=”mainTable1″>     <button class=”btn btn-primary dropdown-toggle” type=”button” data-toggle=”dropdown”>         <i class=”fa fa-gear”></i>         Show Hide Columns         <span class=”caret”></span>     </button>     <ul class=”dropdown-menu”></ul> </div> Here data-target=”mainTable1″ -> here mainTable1 represents the id for datatable Required Dependent JS Snippet function ShowHideColumn(target, colIndex) { var mTable = ‘#’ + target; var myDataTable = $(mTable).DataTable(); // Get the column API object var column = myDataTable.column(colIndex); // Toggle the visibility column.visible(!column.visible()); …

Help Doc For Dynamic ShowHideColumns Related to DataTables Read More »