diff --git a/src/views/cells/action-cell.js b/src/views/cells/action-cell.js index 76bd113..76d036b 100644 --- a/src/views/cells/action-cell.js +++ b/src/views/cells/action-cell.js @@ -13,7 +13,12 @@ var ActionCell = Datagrid.ActionCell = Cell.extend({ a.html(this.options.label); a.attr('href', this.options.href || '#'); if (this.options.actionClassName) { - a.addClass(this.options.actionClassName); + var actionClassName = this.options.actionClassName; + // Check if the classname is actually a callback and run it if it is. + if (_.isFunction(actionClassName)) { + actionClassName = actionClassName(this.model); + } + a.addClass(actionClassName); } if (this.options.action) { this.delegateEvents({ diff --git a/src/views/table.js b/src/views/table.js index 7f2261d..af1ebc8 100644 --- a/src/views/table.js +++ b/src/views/table.js @@ -8,7 +8,7 @@ var Table = Datagrid.Table = ComposedView.extend({ this.pager = this.options.pager; this.sorter = this.options.sorter; - this.listenTo(this.collection, 'reset sort', this.render); + this.listenTo(this.collection, 'reset', this.render); }, render: function() {