@Pranava Sheoran : Yes I manage to find a work around like this :
Most likely what do you have to do is to catch the event from the view.
Here is my button in my YUI table :
{
key: "id",
label: "Detail",
formatter: '<button class="view-btn" data-value="{value}">View</button>',
allowHTML: true
}
With this line, it will generate button with a data-value equal the value you give in your data.
You catch the event like this in your view :
App.YourView = Ember.View.extend({
didInsertElement: function() {
var that = this;
this.$().on('click', '.view-btn', function() {
var id = $(this).attr('data-value');
that.get('controller').send('myMethod', id);
});
}
});
Most likely the didInsertElement is called when your view was rendered. So you can use simple JQuery code in this part. And you send to your method whatever you want to send from the event (here my id) and you catch it with your controller and router like this :
App.MyController = Ember.ObjectController.extend({
actions: {
enquiryView: function(id) {
this.transitionToRoute('enquiry', id);
}
});
App.MyRoute = Ember.Route.extend({
model: function(param) {
// fetch your data with param = your id. (if you have setup your map like me like /mypage/:mypage_id)
}
});
Hope this can help you !!