comindware.ui
Version:
Comindware Core UI provides the basic components like editors, lists, dropdowns, popups that we so desperately need while creating Marionette-based single-page applications.
32 lines (29 loc) • 1.14 kB
JavaScript
define([ 'comindware/core', 'demoPage/views/EditorCanvasView' ], function (core, EditorCanvasView) {
'use strict';
var model = new Backbone.Model({
referenceValue: {
id: 'test.1',
text: 'Test Reference 1'
}
});
return function () {
return new EditorCanvasView({
editor: new core.form.editors.ReferenceEditor({
model: model,
key: 'referenceValue',
autocommit: true,
controller: new (core.form.editors.reference.controllers.DemoReferenceEditorController.extend({
addNewItem: function (callback) {
alert('Added');
callback({
id: 'test.new',
text: 'New Item'
});
}
})),
showAddNewButton: true
}),
presentation: "{{#if referenceValue}}{ id: '{{referenceValue.id}}', text: '{{referenceValue.text}}' }{{else}}null{{/if}}"
});
};
});