Skip to main content

Is there a way to check if a user has made a change to any field in a view (without an editable list)?

 

Hi NigelS

 

There is no "dirty" property you can check. What you could do is create a hidden field (e.g. called IsDirty) and then create a rule for each controls changed event and set this hidden field to true. If you are populating data when the form loads this makes it a bit more complicated as the changed event will fire as each control is populated. You could add another hidden field (HasFormLoaded) with a default value of false that is set to true on the form Initialized rule,  and then add a condition to all of your changed events to see if this is true before setting the IsDirty flag.

 

Not ideal but it should work. Might be worth requesting this as a feature from K2.


Yes that makes sense. I'll put in the request but one more question.

 

I haven't done any .net coding in K2 yet but I'd be interested in this. Is there a way to enumerate all the controls at view Initialize and hook any visible control that has a Changed event to a common handler that sets an isDirty field?


Hi NigelS

 

There is no way to do this OOTB. You "may" be able to achieve this with some javascript/jquery but someone with more knowledge than me may be able to answer that.


Reply