Hi using this skuid.$M(‘model’).datad0].ui_richtext always returns undefined. Other types of UI only fields work fine using this syntax. Any pointers?
Looks like that should work.
If it returns undefined, then a field by that name isn’t in the model. When you run skuid.$M(‘model’).getFirstRow() in the console, does the object include ui_richtext?
Generally, using skuid.$M(‘model’).getFirstRow().ui_richtext would be preferable, since it’s always better to use a documented method than an undocumented one, but they do exactly the same thing.
Thanks! It works on a UI rich text field using standard render. I’m using a custom render, which sets the value from another model in a snippet. When I check the value on the Save button, it returns undefined. But if I edit the field by adding some dummy values, then click on Save, it returns a value. Looks like a bug?
I don’t think a custom renderer will change the value in the model. To do that, you’d have to updateRow() first.
at the end of your custom renderer script, do something like this:
skuid.$M('model').updateData(field.row,field.id,value,{initiator_id:field._GUID});
Thanks. That would save the model to salesforce?
How do I get to the field using jQuery? $(“#uifieldid”) .val() does not work.
The code above doesn’t save the value, it just updates the model, which will then have unsaved changes. You can perform a separate save action if that’s what you want.
Why access the value with jQuery when you can get to it with the skuid api instead?
If you really want to try jQuery, you can try $(“#uifieldid”) in the console and see what your options are.
The problem is I cannot get to it in Skuid. I tried to add
skuid.$M(‘NewContactResult’).updateData(field.row,field.id,value,{initiator_id:field._GUID});
after:
skuid.ui.fieldRenderersrfield.metadata.displaytype]“edit”;
It says Model NewContactResult has unsaved changes and asks me to save it first. Now I’m going back to my original requirement. I don’t want to save the model yet. I want user to be able to click on the Save themselves.
J… there was a typo in the code I gave you.
You don’t want to updateData() - which is a query.
You want to updateRow().
Add this line to your field renderer instead:
field.model.<b>updateRow</b>(field.row,field.id,value,{initiator_id:field._GUID});
If the model you want to update isn’t the field’s model, you can also use
skuid.$M('NewContactResult').<b>updateRow</b>(field.row,field.id,value,{initiator_id:field._GUID});
Thanks! That did the trick.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.