Identify which model has unsaved changes

Craig RosenbaumCraig Rosenbaum ✭✭✭✭
edited June 25, 2020 in Ideas
Question/Idea

Is it possible to display which model has unsaved changes when you try to leave a page? Some pages can be pretty complex and its difficult to identify which model didn't get saved/canceled. 

It would be very helpful to show this in the console. I would prefer the console to show the name of the model (maybe even a list of the unsaved changes on that model) than the window alert because the end user does not necessarily need to know.

My current way of adding a save button for each model to see which one is still enabled isn't very efficient.
1
1 votes

Awaiting Review · Last Updated

Comments

  • edited June 25, 2020
    I believe one of the rendering choices is "unsaved changes in model". You could have a rich text for each of your models with the name of the model and render them only when there are unsaved changed.
  • Craig RosenbaumCraig Rosenbaum ✭✭✭✭
    edited July 21, 2016
    Right, similar to what I do with the save buttons but that would show specifically which model.

    The problem is I only want to see it when I'm debugging something new and would prefer to avoid adding something custom like that for each page. The page I'm on now has about 20 models. 
  • Pat VachonPat Vachon 💎💎💎
    edited July 21, 2016
    skuid.model.list() is how you can see the models in the console.

    Then you could use this snippet to show which have unsaved changes.
    var $ = skuid.$;  $.each(skuid.model.list(),function(m,model){     if(model.hasChanged){         console.log(model.id);     } });
  • Craig RosenbaumCraig Rosenbaum ✭✭✭✭
    edited July 21, 2016
    Fantastic, that will definitely help. Now, for bonus points, how would I set up that snippet to run when the user tries to leave the page?
  • Pat VachonPat Vachon 💎💎💎
    edited July 21, 2016
    Hmmm... you could use this snippet in conjuction with action framework, but not tying into the default "Warn user if page has unsaved changes" set to yes and closing the page or navigating away from the page. At least not with anything documented. It would be a idea to add this functionality though.

    image

    Right here under the model option to provide a picklist option with use "Model Id" and "Custom". Similar to auto table filters on picklists and lookups.

    image
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!