SHARE
TWEET
inventory.js
a guest
Aug 22nd, 2014
165
Never
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]');
- }
- });
- }
- }
- }
- });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
