We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Ajax Call and Pagging Issue

Thread ID:

Created:

Updated:

Platform:

Replies:

143492 Mar 22,2019 11:36 AM UTC Mar 22,2019 12:08 PM UTC Vue 1
loading
Tags: Data Grid
sundar sambandam
Asked On March 22, 2019 11:36 AM UTC

Hi there,

I am trying to load the grid data on click of button using ajax(axios)  call but I am unable to handle paging events?
I really appreciate if you show me some example to handle this situation.

Thanks & Regards
Sundar



Pavithra Subramaniyam [Syncfusion]
Replied On March 22, 2019 12:08 PM UTC

Hi sundar, 
 
Greetings from Syncfusion. 
 
You can catch the Grid Paging action by using the “actionBegin” and “actionComplete” events which will be triggered before and after the page action is done. Please refer to the below code example, documentation link and sample link for more information. 
 
[vue.js] 
new Vue({   
              el: '#app', 
              template: ` 
    <div id="app"> 
    <ejs-button id='collapse' cssClass='e-flat' @click.native='click'>Data</ejs-button> 
        <ejs-grid id="Grid" ref="grid" :actionBegin="Begin" :actionComplete="Complete" :allowPaging='true' height='315px'> 
          <e-columns> 
             .  .  . 
          </e-columns> 
        </ejs-grid> 
    </div> 
`, 
 
   
   methods: { 
     click: function() { 
       axios.get('https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Orders') 
    .then(function (response) { 
    this.$refs.grid.ej2Instances.dataSource=response.data.d; 
    }) 
       
   }, 
   Begin: function(e){ 
     if(e.requestType == 'paging'){            // triggers before Paging action 
       console.log("BeforePaging"); 
     }      
   }, 
   Complete: function(e){ 
     if(e.requestType == 'paging'){      // triggers after Paging action 
       console.log("AfterPaging"); 
     } 
    } 
   }, 
    provide: { 
    grid: [Page] 
  } 
 
                              https://ej2.syncfusion.com/vue/documentation/api/grid/#actioncomplete  
 
Sample               : https://plnkr.co/edit/NxT5YEINUoyD0mGJuGGa?p=preview  
 
Please get back to us if you need further assistance. 
 
Regards, 
Pavithra S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon