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. Image for the cookie policy date

Save Grid and Columns properties

Hello,

I am trying to save kind of a layout of my actual data table, which will include the both grid and columns properties/attrs (ex: enableFiltering, column widths, fields, etc..) without saving useless information, like the dataSource.

Previusly working with JS1 I used to access the grid instance and save my actual model (ex: "$('#gridId').ejGrid('instance').model"), how can I do a similar thing with JS2 and Vue?

Thanks

3 Replies

PS Pavithra Subramaniyam Syncfusion Team May 24, 2019 09:58 AM UTC

Hi Abdelali,  
 
Greetings from Sycnfusion. 
 
You can get all grid and column properties by using the “grid.properties” as below. Please refer to the below code example and sample link for more information. 
 
[Vue] 
<template> 
  <div id="app"> 
    <button v-on:click="click()">Properties</button> 
     <ejs-grid ref='grid' id='grid' :dataSource="data" :allowPaging='true' :pageSettings='pageSettings' :editSettings='editSettings' :toolbar='toolbar' 
     :allowFiltering='true'> 
        <e-columns> 
         .   .   . 
        </e-columns> 
    </ejs-grid> 
  </div> 
</template> 
 
<script> 
   methods: { 
    click: function() { 
       var temp = Object.assign({},this.$refs.grid.ej2Instances.properties); 
       Vue.delete(temp, 'dataSource');                  // her we have removevd the dataSource. You can also keep only required properties  
       console.log(temp); 
    } 
        }, 
  provide: { 
 
 
 
Please get back to us if you need any further assistance on this. 
 
Regards,  
Pavithra S. 



AM Abdelali Mounsif May 24, 2019 10:29 AM UTC

Thank you!


PS Pavithra Subramaniyam Syncfusion Team May 24, 2019 12:15 PM UTC

Hi Abdelali,  

Thanks for your update. 

Please contact us if you need any further assistance. As always, we will be happy to assist you.  

Regards,  
Pavithra S. 


Loader.
Live Chat Icon For mobile
Up arrow icon