backbone-forms
backbone-forms copied to clipboard
InlineNestedModel not working on latest version
Not a direct issue with BBF (except a reminder to decouple Modal Adapter from List) but I am having an issue with using InlineNestedModel with current BBF.
Does anyone have any working examples with current version? I need to avoid using a modal window to add additional models to a collection.
On current pasted wiki version, having an issue with templates.
Including @philfreo -- Phil, does your entry on the Wiki (https://github.com/powmedia/backbone-forms/wiki/Custom-Editors) still work on current implementation and I'm just not implementing properly?
I haven't upgraded my app to the refactored (0.12+) Backbone-Forms yet, so no, but when I do I'll be sure to post my updated version. The main thing is the template stuff which has changed.
Phil Freo, Jr. http://philfreo.com/
On Fri, Nov 15, 2013 at 12:33 PM, brianlucas [email protected]:
Including @philfreo https://github.com/philfreo -- Phil, does your entry on the Wiki ( https://github.com/powmedia/backbone-forms/wiki/Custom-Editors) still work on current implementation and I'm just not implementing properly?
— Reply to this email directly or view it on GitHubhttps://github.com/powmedia/backbone-forms/issues/320#issuecomment-28601137 .
I've created an updated version here: https://gist.github.com/brianlucas/7491366
I'm implementing as follows:
var UserIncome = Backbone.DeepModel.extend({ modelName: "UserIncome", schema: { other_income: { type: 'List', itemType: 'InlineNestedModel', model: OtherIncome },
};
var OtherIncome = Backbone.DeepModel.extend({ modelName: "OtherIncome", schema: { income_source_other_amount: { type: "Number", title: "Other income - Monthly Amount", validators: ["required"], editorAttrs: { placeholder: "1200" }, subsection: "employment 5" }, }, defaults: { income_source_other_amount: null, } });
I get the "Add button" but it renders the field as the template above with the literal {{fields}} block showing in it's place. Is there an easy way to swap out the proper _.template value to enable it to render the schema?
I've updated your version, it works fine for me. https://gist.github.com/spike2k/8296846#file-inlinenestedmodel-js
Has anyone updated the custom InlineObject editor (here: https://github.com/powmedia/backbone-forms/wiki/Custom-Editors) for working with Objects instead of NestedModels?
does anyone have an updated version of this script?