Change Events and Nested Fields

178 views
Skip to first unread message

F. Summers

unread,
Sep 16, 2012, 6:59:36 PM9/16/12
to backbon...@googlegroups.com
I have the following schema: 

schema: {
name: { type: "Text" },
details: { type: "List", itemType: "Object", subSchema: {
selectField: {  type: "Select", options: notificationTypes },
number: { type: "Number" },
}
}
}
}

Trying to capture the change event on "selectField" doesn't seem to work.  I've tried form.on('selectField:change', ... ) but the callback is never fired.

Thanks,
Fred

Charles Davison

unread,
Sep 17, 2012, 9:06:13 AM9/17/12
to backbon...@googlegroups.com
Have you tried form.on('details.selectField:change')?

F. Summers

unread,
Sep 17, 2012, 9:27:55 AM9/17/12
to backbon...@googlegroups.com
I have tried that without any luck.  Stepping through the backbone trigger code I noticed that the event that is triggered is "selectField:change" but there doesn't seem to be a callback associated with it.

matt tate

unread,
Nov 3, 2012, 4:51:36 PM11/3/12
to backbon...@googlegroups.com
Any luck fixing this? Doesn't seem to be working for me either.

dot Config

unread,
Feb 13, 2013, 1:08:07 PM2/13/13
to backbon...@googlegroups.com
looks like this is exactly what i've hit as well...
Message has been deleted

Adrien Grsmto

unread,
Apr 2, 2014, 7:43:28 AM4/2/14
to backbon...@googlegroups.com
You can do this like that :

this.form.fields.details.editor.on('item:open', function(listEditor, itemEditor) {
    itemEditor.modalForm.fields.selectField.editor.on('change', function(itemEditor) {
         console.log(itemEditor.getValue());
    });
});
Reply all
Reply to author
Forward
0 new messages