@(Html.EJ().Grid<object>("Grid") . . . . . .ClientSideEvents(eve=>eve.DataBound("dataBound")) )
<script type="text/javascript"> function dataBound(args) { var pager = $("#"+this._id+" .e-pager").clone();//get the clone element of grid pager pager.insertBefore("#"+this._id+" .e-gridheader");//insert the cloned element before the grid header } <script type="text/javascript"> function dataBound(args) { $("#"+this._id+" .e-pager").insertBefore("#" + this._id + " .e-gridheader");//insert the pager element before the grid header } |
<script type="text/javascript">
//actionComplete event of the Grid function onComplete(args) { processTopPager(this); // Perform clone pager functionalities }
function processTopPager(gridObj) { // Create a clone pager var pagerClone = gridObj.getPager().clone(true); // Replace the id to numeric container element in the clone pager pagerClone.find("#NumericContainer").prop("id", "NumericContainer1");
// Prepend the clone element in the Grid control if (gridObj.element.find("#clonePager").length) gridObj.element.find("#clonePager").html(pagerClone.html()); else gridObj.element.prepend(pagerClone.prop("id", "clonePager"));
// Perform Paging operation while clicking clone pager gridObj.element.find("#NumericContainer1 a").click(function (e) { $("#Grid").ejGrid("gotoPage", $(this).html()); }); } |