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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Manually set control value in localStorage

Thread ID:

Created:

Updated:

Platform:

Replies:

127524 Nov 21,2016 02:21 PM UTC Nov 24,2016 07:33 AM UTC ASP.NET MVC 5
loading
Tags: Grid
Arthur
Asked On November 21, 2016 02:21 PM UTC

Hello,

can i manually set/ change the stored value from the localStorage without reloading the whole page?
Dou you have functions for that? Or do i need to set it myself?

Arthur

Prince Oliver [Syncfusion]
Replied On November 22, 2016 07:09 AM UTC

Hi Arthur,   
  
Thank you for contacting Syncfusion support.   
  
To set or change the value of dropdownlist from local storage, we can use our enablePersistence property of our Dropdownlist.    
  
Refer to the following UG Document link:   
  
Regards,   
Prince 


Arthur
Replied On November 22, 2016 07:25 AM UTC

Hello,

this ony describes how to access it, not how to change the value in the control.

Prince Oliver [Syncfusion]
Replied On November 23, 2016 09:25 AM UTC

Hi Arthur,   
   
Thanks for your update.   
   
EnablePersistence property updates the control’s model value on local storage upon load and unload event. If we need to change the control’s value stored in browser’s local storage, then we need to manually edit the stored values in the cookies.   
   
Control state stored with below mentioned format.   
"$ej$" + control-plugin-Name + control-id   
   
Ex:   
"$ej$ejDropDownListskillsets".   
   
To store the values, you can use the control’s persistState method, which can be accessed through control’s object. When you call persistState method, the control’s model value will be stored in the local storage.   
   
In order to edit the control state value use window.localStorage.setItem and value can be accessed using window.localStorage.getItem methods.   
   
Note: Manually handling the control state storage is not a recommended way. when page is refreshed the controls, value will be automatically set to the local storage, if enablePersistence property is used.   
  
Please explain your scenario where you will be editing the controls value in local storage without altering the value in control   
   
Let us know if you require any further assistance.   
    
Regards,   
Prince   


Arthur
Replied On November 23, 2016 10:19 AM UTC

Thanks,

will test it! My scenario is: 

I have 4 Controls for my Grit i want to filter. The User should set first all Filter Controls and then click a Button to apply all the Filters to the unterlying Grid.


Ragavee U S [Syncfusion]
Replied On November 24, 2016 07:33 AM UTC

Hi Arthur, 

We suspect that your requirement is to perform external filtering in grid. We can achieve this using the filterColumn method of the Grid. Please refer to the below online link for more information. 


We can obtain the values from the control and pass the filterCollection array to the filterColumn method as explained in the above documentation. 

Else, if you want to save the state of the grid and fetch the saved state, please refer to the knowledge base link where we have discussed on this topic. 


Regards, 
Ragavee U 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.

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

;