Below is my ember controller defined search_property and i have callback bind method portfolio_name for class name, i have changed search_property and currentSortIcon in code but my binding method is not invoking.
App.MemberCreditPortfoliosIndexController = Ember.ArrayController.extend(
search_property: null
sort_data: (property) ->
@set('search_property', property)
@set('sort_ascending', !@get('sort_ascending'))
if @get('sort_ascending') == true
@set('search_order', 'ASC')
sortIcon = 'icon-up'
#@set('sort_ascending', false)
else
@set('search_order', 'DESC')
sortIcon = 'icon-down'
#@set('sort_ascending', true)
@transitionTo({page: 1, search_string: @get('search_string'),search_property: property, search_order: @get('search_string')})
@set 'currentSortIcon', sortIcon
portfolio_name: (->
@getSortIcon('portfolio_name')
).property('search_property', 'currentSortIcon')
)
i have written my bind-attr for class in handlebars views.
<th {{action 'sort_data' 'portfolio_name' }} ><span {{bind-attr class="portfolio_name :pull-right"}}></span>Portfolio Name</th>
please let me know if anything i missed or wrong.
Aucun commentaire:
Enregistrer un commentaire