How to hide or disabled pagination in Data grid?

Hello, 
How to hide or disabled pagination in Data Grid on Add click Event in Vue.js? 


3 Replies

RS Rajapandiyan Settu Syncfusion Team May 29, 2020 01:48 PM UTC

Hi Shivani, 

Greetings from syncfusion support. 

Query : How to hide or disabled pagination in Data Grid on Add click Event in Vue.js?  

Based on your query you need to disable the page container in the grid by click event. We have achieved your requirement by adding a CSS class e-disabled to the pagecontainer element and set the pointerEvents as none in the external button click. In this case we used two buttons, one for disable purpose and another one for enable purpose. Please refer the below code example and sample for more information. 


<button v-on:click="enablePage">enable page container</button> 
    <button v-on:click="disablePage">disable page container</button> 
    <ejs-grid 
      ref="grid" 
      :dataSource="data" 
      :allowFiltering="true" 
      :allowPaging="true" 
      :filterSettings="filterOptions" 
      height="250px" 
    > 
    </ejs-grid> 



methods: { 
    enablePage: function(args) { 
// get the pagecontainer and remove e-disabled class 
      this.$refs.grid.$el.querySelector(".e-gridpager .e-pagercontainer").classList.remove("e-disabled"); 
// set the pointer event as ‘’ 
      this.$refs.grid.$el.querySelector(".e-gridpager .e-pagercontainer").style.pointerEvents = ""; 
    }, 
    disablePage: function(args) { 
// get the pagecontainer and add e-disabled class 
      this.$refs.grid.$el.querySelector(".e-gridpager .e-pagercontainer").classList.add("e-disabled"); 
// set the pointer event as none 
      this.$refs.grid.$el.querySelector( ".e-gridpager .e-pagercontainer").style.pointerEvents = "none"; 
    } 
  } 



Please get back to us if you need further assistance on this. 

Regards, 
Rajapandiyan S


SH Shivani June 1, 2020 02:13 AM UTC

Thank you so much for your quick reply. 
I got the result what I want. Thank you.


RS Rajapandiyan Settu Syncfusion Team June 1, 2020 07:18 AM UTC

Hi Shivani, 

We are glad that the provided solution is resolved your requirement. Please get back to us if you need further assistance on this. 

Regards, 
Rajapandiyan S 


Loader.
Up arrow icon