1

I am new to emberjs and just started using addepar table. I need to add my own customization on click of a row in the table. Could someone please tell how can I override the default click/or row selection operation for the addpar table?

I am trying to achieve to call a new route on click of a row at any column in a row. Render the new route based on the row selected.. say displaying summary and detail of the record. Addepar table displays list of summary of records on click of a row displays in details.

Please let me know the steps to customize on click for entire row selection.

thanks, eskarthick

4

1 回答 1

2

为此,您扩展 Ember Table 并覆盖行视图。行视图设置在这里,默认为Ember.Table.TableRow

https://github.com/Addepar/ember-table/blob/master/src/component.coffee#L119

结果将如下所示:

App.MyTableComponent = Ember.Table.EmberTableComponent.extend({
  tableRowView: 'App.MyTableRow'
});

App.MyTableRow: Ember.Table.TableRow.extend({
  click: function() {
    // Handle click
  }
});

这假设您真的关心点击事件。相反,如果您只想对选定的行(或当它被选定时)做一些事情,您应该使用selectionEmber Table API 的输出并在其周围添加计算属性/观察者。请参阅以下位置的文档:

http://addepar.github.io/ember-table/#/ember-table/documentation

于 2015-02-09T22:31:51.077 回答