ui only field change to not register as model changes

  • 10
  • Idea
  • Updated 1 year ago
  • Under Consideration
I've created a UI Only field called "Running Balance". Works great except that I have to save the model on page load as the custom field updates the rows in order to display the values.

I'd like the option to exclude the field from registering as a model change.

Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb

Posted 3 years ago

  • 10
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
YES!
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Sounds reasonable. 
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
^^^ experiencing this as an issue once again. bump for votes. ^^^
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
^^^ and again ^^^
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Would that I had another 10 votes for this!
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
I shall vote with ye
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Stumbled upon this work around. If possible, set the UI field to read only. ;) I'm using js to set a running balance ui only field.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Another situation where this is coming up. Working on another workaround using CSS.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I've started running this line of jQuery after pageload or the javascript that changes the fields:

$('.nx-modified').removeClass('nx-modified');
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Well #$%. That's a very simple work around. Why didn't I think of that.
Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,776 Points 4k badge 2x thumb
I'm running this jQuery along with rendering the table. This re-enables filters/search, but when they are used, I get the unsaved changes error:

Uncaught Model 'Products' has unsaved changes. To update this model's data, you must first save or cancel the changes.
I'm only updating UI only fields. Have you been able to filter or search after modifying UI only fields without saving the model?
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Thanks Matt, great idea!
Photo of Allison

Allison

  • 1,158 Points 1k badge 2x thumb
I'm having the same issues but not sure how to implement the solution above.  Can anyone explain for a non-coder?