You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current approach to default options is problematic. If we create multiple instances of carpenter on a page and change the default options, due to how prototypes behave the changed config options will bleed through to other instances of the table controller. This will cause unexpected behavior.
The fix is to adopt the defaults pattern used by Brian Mann. Previous references to the prototypes in the table controller must now be prefixed with @config.
@config.selectable
@config.filterTemplatePath
Original:
class Marionette.Carpenter.Controller extends Controller
# @property [Boolean] allow checkbox selection of table rows
selectable: false
# @property [String] the path to the (optional) template for the Filter view
filterTemplatePath: ''
# @property [Boolean] allow rows in the table to be tagged
taggable: false
# @property [String] text to show in the table header
title: null
# @property [Boolean] do not use AJAX to sync the models
static: false
# @property [Boolean] fetch collection on initialization
fetch: true
# @property [String] attribute name of the default sorted column
# Defaults to the first sortable column if this property is null.
defaultSort: null
New:
class Marionette.Carpenter.Controller extends Controller
defaults: ->
selecatable: @selectable
filterTemplatePath: @filterTemplatePath
.....
.....
.....
# @property [Boolean] allow checkbox selection of table rows
selectable: false
# @property [String] the path to the (optional) template for the Filter view
filterTemplatePath: ''
# @property [Boolean] allow rows in the table to be tagged
taggable: false
# @property [String] text to show in the table header
title: null
# @property [Boolean] do not use AJAX to sync the models
static: false
# @property [Boolean] fetch collection on initialization
fetch: true
# @property [String] attribute name of the default sorted column
# Defaults to the first sortable column if this property is null.
defaultSort: null
The text was updated successfully, but these errors were encountered:
The current approach to default options is problematic. If we create multiple instances of carpenter on a page and change the default options, due to how prototypes behave the changed config options will bleed through to other instances of the table controller. This will cause unexpected behavior.
The fix is to adopt the defaults pattern used by Brian Mann. Previous references to the prototypes in the table controller must now be prefixed with @config.
Original:
New:
The text was updated successfully, but these errors were encountered: