Skip to main content
Nintex Community Menu Bar
Question

What are the config options for skuid.ui.Field() constructor?

  • July 9, 2024
  • 4 replies
  • 17 views

Forum|alt.badge.img+18

What can I configure, aside from:


{

        fieldId: ‘MailingCity’,

        register: true

    }

as shown in the docs.

Can I set all the parameters for a basic field editor (unique id, layout, mode, etc.)?  Or are those options in an skuid.ui.Editor()? The only option I see in the Editor docs is show save/cancel.


Thanks!

This topic has been closed for replies.

4 replies

Forum|alt.badge.img+13

You can use this to set Field-level options, not Field-Editor level options. Since we don’t have these specific properties documented, I won’t describe in more detail here unless you have a specific need.

The way to set parameters for a Field Editor through JavaScript would be through the XML properties on the tag.


Forum|alt.badge.img+18
  • Author
  • July 9, 2024

If I have a field editor with one field created with the skuid component factory, and I want to be able to change the mode of the field between edit and readonly with javascript, is there a preference between doing that at the editor level or the field level?

For the former, I’m assuming I could .attr(“mode”, “edit”) with a jQuery selector on the editor?
And the latter, .attr(“readonly”, “false”) with a selector on the field?

Is there a better way?

Thanks!


Forum|alt.badge.img+13

You could do it at either level, I think that it’s more scalable to do it at the Field Editor level because then you don’t have to worry about adding fields later.

The following Snippet will find a particular Field Editor by its Unique Id (e.g. here “TestFieldEditor”) and toggle it between Read / Edit mode. If you want a button that only sets it to Edit mode, you can easily adapt the code to do that:

var fieldEditor = skuid.$('#TestFieldEditor').data('object');<br>fieldEditor.mode = fieldEditor.mode === "edit" ? "read" : "edit";<br>fieldEditor.list.render({ doNotCache: true });

Forum|alt.badge.img+18
  • Author
  • July 9, 2024

Sweet. Thanks, Zach!