Тема: store collect
Показать сообщение отдельно
  #2 (permalink)  
Старый 03.09.2012, 18:00
Аватар для Ex_Soft
Профессор
Отправить личное сообщение для Ex_Soft Посмотреть профиль Найти все сообщения от Ex_Soft
 
Регистрация: 19.12.2009
Сообщений: 164

Сообщение от http://docs.sencha.com/ext-js/4-1/source/Store.html#Ext-data-Store-method-collect
collect: function(dataIndex, allowNull, bypassFilter) {
        var me = this,
            *!*data*/!* = (bypassFilter === true && me.snapshot) ? me.snapshot : me.*!*data*/!*;

        return data.collect(dataIndex, 'data', allowNull);
    },
Удаленные же записи сидят в removed:
Сообщение от http://docs.sencha.com/ext-js/4-1/source/Store.html#Ext-data-Store-method-remove
remove: function(records, /* private */ isMove) {
        if (!Ext.isArray(records)) {
            records = [records];
        }

        /*
         * Pass the isMove parameter if we know we're going to be re-inserting this record
         */
        isMove = isMove === true;
        var me = this,
            sync = false,
            i = 0,
            length = records.length,
            isNotPhantom,
            index,
            record;

        for (; i < length; i++) {
            record = records[i];
            index = me.data.indexOf(record);

            if (me.snapshot) {
                me.snapshot.remove(record);
            }

            if (index > -1) {
                isNotPhantom = record.phantom !== true;

                // don't push phantom records onto removed
                if (!isMove && isNotPhantom) {

                    // Store the index the record was removed from so that rejectChanges can re-insert at the correct place.
                    // The record's index property won't do, as that is the index in the overall dataset when Store is buffered.
                    record.removedFrom = index;
                    me.*!*removed*/!*.push(record);
                }

                record.unjoin(me);
                me.data.remove(record);
                sync = sync || isNotPhantom;

                me.fireEvent('remove', me, record, index);
            }
        }

        me.fireEvent('datachanged', me);
        if (!isMove && me.autoSync && sync && !me.autoSyncSuspended) {
            me.sync();
        }
    },
__________________
"Helo, word!" - 17 errors 56 warnings
Ответить с цитированием