Remember a User's choice when using Jquery effect in a snippet

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I have a feeling this might not be possible, but I thought I would ask anyways....

I built a tab page with an advanced search that is used to set condition values on the main table. I created a button that will show/hide the advanced search section by the click of a button. Using JQuery I can get this to work great.

---JavaScript Snippet on the button is... ---

var params = arguments[0],
$ = skuid.$;

$('#advancedSearch').slideToggle("Slow");


My question is....Is it possible for Skuid to store the value for the running user if they like the search closed or open by default on the page? I couldn't find an answer to this, but wanted to see if anyone out there could confirm my thinking.

Thanks!

Jeff
Photo of Jeff Rutter

Jeff Rutter

  • 1,162 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Adam Edmonds

Adam Edmonds

  • 454 Points 250 badge 2x thumb
One thought I've had in the past is to create a UserPreferencs object in Salesforce. Adding the new object as a model to the page would then allow you to store settings for use in rendering and preferences.
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
Jeff,

Adam's suggestion is probably your best option. That user choice is not something Skuid is able to remember, so the choice would need to be stored in an actual field in Salesforce somewhere

Thanks!
Photo of Jeff Rutter

Jeff Rutter

  • 1,162 Points 1k badge 2x thumb
Thanks Adam and Amy for your thoughts. Really appreciate it. I was wondering if storing the value somewhere would be necessary...I'll investigate that option.

Thanks again,

Jeff
Photo of Adam Edmonds

Adam Edmonds

  • 454 Points 250 badge 2x thumb
The use of the dedicated object opens up a lot of possibles as far as letting your users tailor their own use and experience of the application. Plus it makes your life easier because you can then add the preference model to your master page (if applicable) and then use the preference model throughout.
Photo of Jeff Rutter

Jeff Rutter

  • 1,162 Points 1k badge 2x thumb
That's a great idea! Thanks for sharing the tip! On a master page that would be amazingly useful too