daily pastebin goal
26%
SHARE
TWEET

inventory.js

a guest Aug 22nd, 2014 165 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //.. load page dependencies
  2.  
  3. module.exports = PageView.extend({
  4.     pageTitle: 'Home',
  5.     template: require('../../templates/pages/inventory.hbs'),
  6.  
  7.     initialize: function () {
  8.         console.log(this.model);
  9.  
  10.     },
  11.  
  12.  
  13.     subviews: {
  14.         searchForm: {
  15.             container: 'form[role=search]',
  16.             // this says we'll wait for `this.model` to be truthy
  17.             prepareView: function (el) {
  18.                 var self = this;
  19.                 return new InventorySearchForm({
  20.                     el: el,
  21.                     submitCallback: function (data) {
  22.                         console.log(data);
  23.  
  24.                         self.model = new InventoryItem(data);
  25.  
  26.                         self.renderSubview(new InventoryForm({
  27.                             model: self.model,
  28.                             submitCallback: function (data) {
  29.  
  30.                             }
  31.                         }), 'form[role=inventory-item]');
  32.                     }
  33.                 });
  34.             }
  35.         }
  36.     }
  37. });
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. OK, I Understand
 
Top