mirror of https://github.com/fspc/BikeShed-1.git
Jason Denney
12 years ago
14 changed files with 98 additions and 99 deletions
@ -0,0 +1,9 @@ |
|||
{ |
|||
//this will give a 401 error, but made 401 exceptions forward to 'users/sign_in'
|
|||
onSignOut: function(){ |
|||
Ext.Ajax.request({ |
|||
url: '/users/sign_out', |
|||
method: 'DELETE' |
|||
}); |
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
{ |
|||
initComponent: function(){ |
|||
// calling superclass's initComponent
|
|||
this.callParent(); |
|||
|
|||
// setting the 'rowclick' event
|
|||
var view = this.getView(); |
|||
view.on('itemclick', function(view, record){ |
|||
// The beauty of using Ext.Direct: calling 3 endpoints in a row, which results in a single call to the server!
|
|||
this.selectBikeBrand({bike_brand_id: record.get('bike_brand__brand')}); |
|||
}, this); |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
{ |
|||
initComponent: function(){ |
|||
// calling superclass's initComponent
|
|||
this.callParent(); |
|||
|
|||
// setting the 'rowclick' event
|
|||
var view = this.getComponent('bikes').getView(); |
|||
view.on('itemclick', function(view, record){ |
|||
// The beauty of using Ext.Direct: calling 3 endpoints in a row, which results in a single call to the server!
|
|||
this.selectBike({bike_id: record.get('id')}); |
|||
this.getComponent('bike_logs').getStore().load(); |
|||
}, this); |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
{ |
|||
initComponent: function(){ |
|||
// calling superclass's initComponent
|
|||
this.callParent(); |
|||
|
|||
// setting the 'rowclick' event
|
|||
var view = this.getComponent('bike_brands').getView(); |
|||
view.on('itemclick', function(view, record){ |
|||
// The beauty of using Ext.Direct: calling 3 endpoints in a row, which results in a single call to the server!
|
|||
this.selectBikeBrand({bike_brand_id: record.get('id')}); |
|||
this.getComponent('bike_models').getStore().load(); |
|||
}, this); |
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
{ |
|||
initComponent: function(){ |
|||
// calling superclass's initComponent
|
|||
this.callParent(); |
|||
this.getComponent('user_stats').updateStats(); |
|||
|
|||
var store = this.getComponent('user_logs').getStore() |
|||
store.on('load', function (store, records, operation, success){ |
|||
console.log("Bitches"); |
|||
this.getComponent('user_stats').updateStats(); |
|||
}, this); |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
{ |
|||
updateStats: function(){ |
|||
// Call endpoint
|
|||
this.serverUpdate({}, function(){ |
|||
//success callback
|
|||
}, this); |
|||
} |
|||
} |
@ -0,0 +1,19 @@ |
|||
{ |
|||
initComponent: function(){ |
|||
// calling superclass's initComponent
|
|||
this.callParent(); |
|||
var stats = this.getComponent('user_stats'); |
|||
if (stats != undefined){ |
|||
stats.updateStats(); |
|||
} |
|||
|
|||
// setting the 'rowclick' event
|
|||
var view = this.getComponent('users').getView(); |
|||
view.on('itemclick', function(view, record){ |
|||
// The beauty of using Ext.Direct: calling 3 endpoints in a row, which results in a single call to the server!
|
|||
this.selectUser({user_id: record.get('id')}); |
|||
this.getComponent('user_profiles').getStore().load(); |
|||
this.getComponent('user_logs').getStore().load(); |
|||
}, this); |
|||
} |
|||
} |
Loading…
Reference in new issue