1. #1
    Sencha User
    Join Date
    Nov 2014
    Posts
    7
    Vote Rating
    0
    kaddah is on a distinguished road

      0  

    Default Unanswered: Endless Load in dataview

    Unanswered: Endless Load in dataview


    Hello,

    I created a dataview to log several events.
    When there are too many Elements there is an endless load.

    Here is the code from dataview:
    Code:
    {                xtype: 'dataview',
                    baseCls: 'TextAreaInput',
                    disabledCls: 'none',
                    floatingCls: 'none',
                    height: 200,
                    hiddenCls: 'none',
                    id: 'log-area',
                    styleHtmlCls: 'none',
                    scrollable: {
                        direction: 'vertical',
                        directionLock: true
                    },
                    itemCls: '',
                    itemTpl: [
                        '<div>[{level}] : [{formattedTime}] : {formattedMessage}</div>'
                    ],
                    pressedCls: 'none',
                    scrollToTopOnRefresh: false,
                    selectedCls: 'none',
                    store: 'LocalLogStore'
                }
    the one from the filter:
    Code:
    var logStore = Ext.getStore("LocalLogStore");
    
    var logLevel = Ext.getCmp("log-level").getRecord().raw.value;
    var fromDate = new Date(Ext.getCmp("log-from-date").getValue()).getTime();
    var toDate = new Date(Ext.getCmp("log-to-date").getValue()).getTime() + 1000 * 60 * 60 * 24;
    
    
    
    
    var filters = [];
    
    
     // filter by date period
    filters.push(
        {
            filterFn: function(item) {
                var result = false;
    
    
                // time property can be either string or date
                var itemTime = new Date(item.get("time").toString()).getTime();
                if(itemTime){
                    if(itemTime > fromDate && itemTime < toDate || itemTime === fromDate === (toDate - 1000 * 60 * 60 * 24)){
                        result = true;
                    }else if(fromDate > (toDate  - 1000 * 60 * 60 * 24)) {
                        logStore.removeAll();
                        mbs.app.fireEvent("app_notification_info_show", "fromDate groesser als toDate");                 }
                }
                return result;
            }
        }
    );
    
    
    // filter by level
    if(logLevel != "ALL"){
        filters.push({property: "level",value: logLevel});
    }
    
    
    
    
    // perform filtering
    logStore.clearFilter();
    logStore.filter(filters);
    
    logStore.removeAll();
    logStore.load();
    and the one from the selectfield:
    Code:
    {                xtype: 'selectfield',
                    baseCls: 'DetailsSelect',
                    id: 'log-level',
                    itemId: 'myselectfield',
                    label: 'mbs.report.filter.log.level',
                    value: {
                        text: 'INFO',
                        value: 'INFO'
                    },
                    autoSelect: false,
                    options: [
                        {
                            text: 'ALL',
                            value: 'ALL'
                        },
                        {
                            text: 'DEBUG',
                            value: 'DEBUG'
                        },
                        {
                            text: 'INFO',
                            value: 'INFO'
                        },
                        {
                            text: 'WARN',
                            value: 'WARN'
                        },
                        {
                            text: 'ERROR',
                            value: 'ERROR'
                        }
                    ],
                    usePicker: 'auto',
                    valueField: '',
                    component: {
                        useMask: true
                    }
                }
    hope somebody knows, why the endless load appears...

  2. #2
    Sencha - Support Team lumberjack's Avatar
    Join Date
    Nov 2014
    Location
    Kansas
    Posts
    289
    Vote Rating
    10
    Answers
    32
    lumberjack will become famous soon enough

      0  

    Default


    I'd like to test this along with you. Can you post a simple test case either inline here or at https://fiddle.sencha.com?

    Thanks,
    Brian

  3. #3
    Sencha User
    Join Date
    Nov 2014
    Posts
    7
    Vote Rating
    0
    kaddah is on a distinguished road

      0  

    Default


    thank you for your answer.

    it is a little tricky, but I tried to catch the error with the debugger.

    It appears when
    Code:
    logStore.load();
    is called and the error
    Code:
    cannot read property 'parentnode' of null
    appears.

    I did a workaround when the insertBefore-Method is called in another class with try and catch...

    I think it is not nice but it works so far.

    If something new happens I will write here.

    Thank you so far

Thread Participants: 1

Tags for this Thread