form.addField. Can this be used to add boolean/checkboxes?

25 views
Skip to first unread message

robinne

unread,
Aug 19, 2011, 11:21:48 PM8/19/11
to inputex
Hi. I have an inputex form that I need to add fields to dynamically
based on data from the database. I've tried the addField, but it only
adds a field, I cannot specify it to be a checkbox or boolean field
type. If this is possible, what is the syntax for it? I was trying
something like this:

myfield = new inputEx.CheckBox({rightLabel: 'Check me !', value:
false});
formPackage.addField(myfield);

I would like to add a list of checkboxes to an existing form after
I've made an ajax call. How can I append to an existing form? Thanks!

Maxime RETY

unread,
Aug 26, 2011, 12:41:25 PM8/26/11
to inp...@googlegroups.com
Hi,

You shouldn't instanciate the CheckBox but rather pass the config object (with "type" property to specify the type of field):

form1.addField({type: "boolean", rightLabel: 'Check me !', value:
false})

addField is used internally by inputEx.Form to render each field from the "fields" option (see : http://localhost:8888/inputex/examples/form.html), so it accepts only a config object as a parameter (not an instance of a field).

--
Max



--
You received this message because you are subscribed to the Google Groups "inputex" group.
To post to this group, send email to inp...@googlegroups.com.
To unsubscribe from this group, send email to inputex+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/inputex?hl=en.



Reply all
Reply to author
Forward
0 new messages