Skip to main content

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!

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.


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!


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 });

Sweet. Thanks, Zach!