hi guys
Can anyone guide me how to load data from database when i change the value on the select box? i came up with a solution but its not working.
my component.js
actions:{ filterStudent(){ let filterInputValue = this.get(‘value’); console.log(filterInputValue); let filterAction = this.get(‘filter’); console.log(filterAction); } },
my component hbs file
<select name=“newType” onchange={{action “filterStudent” value=“target.value”}} class=“form-control”>
Please Select {{#each model.Students as |newStudents|}} {{newStudents.studentName}} {{/each}}my Controller
actions: { filterStudentResults(param) { if (param !== ‘’) { return this.get(‘store’).query(‘Students’, { studentName: param }); } else { return this.get(‘store’).findAll(‘Students’); } } } });
Any Help is Appriciated. Thanks