Conditional rendering is great and enables many features that would otherwise require multiple pages of essentially the same thing.
One thing that we find is that “new” and “edit” pages behave almost the same except for some small differences. Unfortunately, there is no way currently in the available conditional rendering to render based on whether or not the record is new or not new because the model will always contain a row when the model property is set to “create default row when model has none”
There are workarounds to this, none of which are really ideal:
1) Check CreatedDate == null
2) Create a fake model and set a condition for a fake field to the value of a url parameter (e.g. id) and then use this value in conditional rendering
3) Jquery/javascript to call skuid.model.isNewId and then css to hide/show appropriate sections
Being able to identify in a conditional rendering criteria if the record is new or existing would greatly simplify the solution.
Thanks!
Question
Expose isNewId functionality in conditional rendering
This topic has been closed for replies.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
