0

コードをここに投稿しました。

type1 と type2 のリンクをクリックすると、ある条件でデータをフィルタリングしています。このフィルタリングのために、すべてのシナリオで合計レコード数を計算できません。

各フィルター処理で type1,type2 の合計レコード数と合計レコード数を計算できるはずです。

App.IndexController = Ember.ArrayController.extend({
         total:function(){ 
           return this.get('content.length'); 
         }.property('content.length'),
         total1: function() {
           return this.get('content').filterProperty('contacttype', 1).get('length');
         }.property('content.@each.contacttype'),
         total2:function(){ 
           return this.get('content').filterProperty('contacttype', 2).get('length');
         }.property('content.@each.contacttype')
    });
4

1 に答える 1