@mahaniff wrote:
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
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');
}
}
}
});am caliing the component in the template as follows
{{bind-dropdown model=model Filter=filterStudentResults}}
Am a newbie to EmberJS and appreciate any help. Thanks in Advance
Posts: 1
Participants: 1