Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4829

Problem of search the folder Items

$
0
0

@Boo wrote:

Hello,

I have multiple folders with corresponding items, in that having search option. If I clicked the checkbox on folder A in the search option, it will show their items (eg. consider it having 4 items) and If I click the another checkbox of folder B (eg. consider it having 4 items) along with the folder A, it will show totally 8 items of folder A and folder B. Now When I remove the folder A or folder B from the checkbox, it still showing the 8 items. But I need only the corresponding folder items selected.

Here are my code:

Checkbox: Core.component.Checkbox.extend({
    click: function () {
        console.log(this);
        var nav = this.get("controller").get('selectedNavigator');
        var ret = this._super.apply(this, arguments);
        Ember.run.schedule('sync', this, function () {
            Ember.run.schedule('render', this, function () {
                var states = this.get('parentView.itemStates');
                var values =  Object.keys(states).filter(function (key) {
                    return states[key];
                });

                if (values.length === 0) {
                    Core.Action('core:contentHome', {});
                } else {
                    this.set('parentView.model.values',values);
                    nav.publish();
                }

            });
        });
        return ret;
    }
})

Please provide the suggestion for this. I’m using Ember 1.4.0. Thanks in advance.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles