Mobile Skuid - Save Callback flicker

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hi,
I am running a custom javascript function to save the model on button click. On the callback the whole page refreshes and scrolled to the top. How can we prevent scrolling to the top of the page on save? Thanks.

-Sravanthi.
Photo of Sravanthi Bommagowni

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
We'd reccomend that the button click be tied to the action framework.  There you can save a model without writing any code.  If your function goes on to do other things that can't be done in the action framework,  you can add a subsequent connection to a javascript snippet into the steps of your action framework. 
Thanks for the reply, Rob. Even if we use the action framework to the save the model, the page scrolls back to the top of the page. Any idea how to prevent that?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Can you map out the steps you are taking in your action framework sequence?  And maybe any more specifics about the environment you are working in (SF1,  Console, Community, Etc).   What you report should not be happening.  Skuid should respect the location of the user and not move it when DML operations are accomplished.  
It is a long page with div sections collapsed and several save buttons.

These are steps on Save button. 
1. Run custom javascript for validations. 
2. Save Model changes.
3. Run custom javascript to change css and enable / disable controls. 

Also subscribed to skuidMobileReady event to run some custom javascript(collapse unused sections, populate fields, change css and enable / disable controls.) 

We are using SF1 enterprise version and Skuid 6.8.1. Does this help?
Found the cause of page jumping, its nothing to do with the model save. It is to do with the .hide() on the div elements after save.  Gave a min-height to the div elements to prevent jumping. Thanks.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Glad to hear this got fixed.