Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //.. load page dependencies
- module.exports = PageView.extend({
- pageTitle: 'Home',
- template: require('../../templates/pages/inventory.hbs'),
- initialize: function () {
- console.log(this.model);
- },
- subviews: {
- searchForm: {
- container: 'form[role=search]',
- // this says we'll wait for `this.model` to be truthy
- prepareView: function (el) {
- var self = this;
- return new InventorySearchForm({
- el: el,
- submitCallback: function (data) {
- console.log(data);
- self.model = new InventoryItem(data);
- self.renderSubview(new InventoryForm({
- model: self.model,
- submitCallback: function (data) {
- }
- }), 'form[role=inventory-item]');
- }
- });
- }
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment