add new field into dynamic form at runtime

Here is the problem:

Users want to have the ability to click on an “add” button to display a new textbox for to enter data in. Each time they click on add, it will insert a new text field onto the screen. So I tried to do something like this:

isc.IButton.create({
        ID: "addWbsButton",
        title: "Add",
        layoutAlign: "center",
        wrap: true,
        click: function () {
            wbsEntryForm.fields[1] = {
                name: "wbsName2",
                title: "WBS 2 Name",
                type: "text"
            };
            wbsEntryForm.markForRedraw();
        }
    });

Just trying to see if I can dynamically add new text fields into my form at runtime, but I can’t seem to get it to work…

Also, if I could get this approach to work, I am wondering how I could have this mapped to my data source…

Actually, I think I will give ListGrid a try. Seems that feature may be able to take care of my requirements…

This thread might help with the DynamicForm setup that you’re looking for:

http://forums.smartclient.com/showthread.php?t=272