Changeset 343 for Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js
- Timestamp:
- 06/18/12 12:51:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js
r303 r343 3 3 return declare('rft.pages.surveys',[_Page],{ 4 4 selectedObject: null, 5 postCreate: function() {6 this._store = store.getStore('Survey');7 },8 5 onVisit: function() { 9 this.grid.setStore(ObjectStore({objectStore: this._store})); 6 this.grid.setStore( 7 ObjectStore({objectStore: store}), 8 "_design/default/_view/by_type",{key:'Survey'}); 10 9 11 10 this.grid.on('rowclick',lang.hitch(this,function(evt){ … … 16 15 this.grid.on('rowdblclick',lang.hitch(this,function(evt){ 17 16 var obj = evt.grid.getItem(evt.rowIndex); 18 content.goTo('/survey',{uid: obj.getUid()});17 content.goTo('/survey',{uid:store.getIdentity(obj)}); 19 18 })); 20 19 21 20 this.btnNew.on('click',lang.hitch(this,function(){ 22 Deferred.when( this._store.add({'creator':auth.getUser()}) )21 Deferred.when( store.add({type:'Survey',creator:auth.getUser()}) ) 23 22 .then(function(obj) { 24 content.goTo('/survey',{uid: obj.getUid()});23 content.goTo('/survey',{uid:store.getIdentity(obj)}); 25 24 }); 26 25 })); … … 28 27 this.btnEdit.on('click',lang.hitch(this,function(){ 29 28 if ( this.selectedObject ) { 30 content.goTo('/survey',{uid: this.selectedObject.getUid()});29 content.goTo('/survey',{uid:store.getIdentity(this.selectedObject)}); 31 30 } 32 31
Note: See TracChangeset
for help on using the changeset viewer.