It looks like Pager (ejs-pager) is not supported anymore ??

it seems it is not possible to use the pager outside of the grid?

<ejs-pager id="pager"    
   pageCount="2" 
   pageSize="3"
   currentPage="page"
   click="??"
   totalRecordsCount="@Model.Data.List.TotalItems">
</ejs-pager>

or I am doing something really wrong?
thanks!
Viktor




3 Replies

MS Manivel Sellamuthu Syncfusion Team May 27, 2020 01:26 PM UTC

Hi Viktor, 

Greetings from Syncfusion support. 

We can use pager separately. To listen the click event of the pager we suggest you to use the below way. Please refer the below code example for more information. 

<ejs-pager id="pager" 
           pageCount="2" 
                 pageSize="3" 
                 currentPage="2" 
                 totalRecordsCount="10"> 
</ejs-pager> 
 
<script> 
// binding event for document 
    document.addEventListener("DOMContentLoaded", setPagerClick) 
    function setPagerClick() { 
// from the pager instance we can listen the click event args 
        var pager = document.getElementById("pager").ej2_instances[0]; 
        pager.click = pagerClick; 
    } 
 
    function pagerClick(args) { 
        console.log(args); 
        alert('CurrentPage: ' + args.currentPage); 
    }  
</script> 

Please let us know, if you need further assistance. 

Regards, 
Manivel 



VI Viktor June 8, 2020 11:32 AM UTC

Hi Manivel ,
sorry for the delayed response.
it works but ... 
unfortunately pager disappears after ajax-requests (if pager is the part of the panel)
the code looks like something like this:

#HTML
<div id="list">
  <ejs-pager id="pager" 
                   pageCount="2" 
                   pageSize="3" 
                   currentPage="2" 
                   totalRecordsCount="10"> 
        </ejs-pager> 
</div>

#JS
$.ajax({
type: "POST",
url: "@Url.Page("_Search", "Filter", new {id = RouteData.Values["id"] ?? "_"})",
headers: { "RequestVerificationToken": '@token' },
success: function(result) {
$("#list").replaceWith(result);
},
error: function() {

}
});

Thanks!
Regards
Viktor


MS Manivel Sellamuthu Syncfusion Team June 9, 2020 10:12 AM UTC

Hi Viktor, 

Thanks for your update. 

From your shared code example we could see that you are replacing the result returned from the ajax on the Pager’s parent container, it will cause to remove the pager element. So we suggest you to replace the result with separate div element or place the pager outside of the div to resolve the issue. 

Please let us know, if you need further assistance. 

Regards, 
Manivel 


Loader.
Up arrow icon