Created
December 1, 2017 09:49
-
-
Save abueloshika/a5ddb668fb377c9596a3fa05ac0b6f5e to your computer and use it in GitHub Desktop.
exampletwiddlereports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
export default Controller.extend({ | |
queryParams: ['dateFrom', 'dateTo', 'unitNumber'], | |
dateFrom: null, | |
dateTo: null, | |
unitNumber: null, | |
actions: { | |
selected(x) { | |
module = x | |
}, | |
onChangeDateFrom(selectedValue) { | |
this.set('dateFrom', moment(selectedValue).format('DD-MM-YYYY')) | |
}, | |
onChangeDateTo(selectedValue) { | |
this.set('dateTo', moment(selectedValue).format('DD-MM-YYYY')) | |
}, | |
submitQuery(dateFrom, dateTo, unitNumber) { | |
switch (module) { | |
case 'Option1 List': | |
this.transitionToRoute('Option1Route', { | |
queryParams: { | |
dateFrom: this.get('dateFrom'), | |
dateTo: this.get('dateTo'), | |
unitNumber: this.get('unitNumber') | |
} | |
}) | |
break; | |
case 'Option2 List': | |
this.transitionToRoute('Option2Route', { | |
queryParams: { | |
dateFrom: this.get('dateFrom'), | |
dateTo: this.get('dateTo'), | |
unitNumber: this.get('unitNumber') | |
} | |
}) | |
break; | |
case 'Option3 List': | |
this.transitionToRoute('Option3 Route', { | |
queryParams: { | |
dateFrom: this.get('dateFrom'), | |
dateTo: this.get('dateTo'), | |
unitNumber: this.get('unitNumber') | |
} | |
}) | |
break; | |
case 'Option5 List': | |
this.transitionToRoute('Option4Route', { | |
queryParams: { | |
dateFrom: this.get('dateFrom'), | |
dateTo: this.get('dateTo'), | |
unitNumber: this.get('unitNumber') | |
} | |
}) | |
break; | |
case 'Select a Module:': | |
alert('Please select a Module') | |
break; | |
default: | |
console.log('error') | |
} | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('reports'); | |
}); | |
export default Router; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.12.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.12.0", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": { | |
"ember-data": "2.12.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment