cc.Class({
    extends: cc.Component,

    properties: {
        btn: cc.Button,
        scrollView: cc.ScrollView,
    },

    onLoad: function() {
        this.btn.node.actice = false;
        cc.game.setFrameRate(30);
        cc.director.setDisplayStats(true);
        this.btn.node.on('touchend', this.onBtnClicked, this);
        this.scrollView_ListViewCtrl = this.scrollView.getComponent("ListViewCtrl");
        cc.loader.loadRes("gameString", function(err, res) {
            if (err) {
                cc.log(err);
            } else {
                this.gameString = res;
                this.btn.node.actice = true;
            }
        }.bind(this));
    },

    onBtnClicked: function() {
        let array = [];
        let dest_array = [];
        let index = 0;
        for (let key in this.gameString) {
            let value = this.gameString[key];
            index = index + 1;
            array.push(value.value);
            if (index >= 800) {
                break;
            }
        }
        for (let i = 0; i < array.length;) {
            let src_array = [];
            src_array.push(array[i]);
            i = i + 1;
            src_array.push(array[i]);
            i = i + 1;
            src_array.push(array[i]);
            i = i + 1;
            src_array.push(array[i]);
            i = i + 1;
            dest_array.push(src_array);
        }
        this.scrollView_ListViewCtrl.handleRefreshItemInfoList(dest_array);
    },

    onEnable: function() {},
});