cmv.champs.championshipstore = new Ext.data.JsonStore({
    proxy: new Ext.data.HttpProxy({
        api: {
            read : 'json/championships.php'
        }
    }),
    autoDestroy: true,
    autoLoad: true,
    root: 'data',
    totalProperty: 'total',
    fields: [{
        name: 'yearid',
        type: 'int'
    }, {
        name: 'year',
        type: 'int'
    }, {
        name: 'actid',
        type: 'int'
    }, {
        name: 'dato',
        type: 'date',
        dateFormat: Date.patterns.ISO8601Long
    }, {
        name: 'overskrift'
    }],
    listeners:{
        load: {
            fn: function(store, records, operation){
                cmv.champs.years=store.collect('year');
                Ext.each(cmv.champs.years,function(yr,index){
                    store.filter('year',yr);
                    cmv.champs.actids=store.collect('actid');
                    cmv.champs.headings=store.collect('overskrift');
                    cmv.champs.datos=store.collect('dato');
                    Ext.each(cmv.champs.headings, function(heading, index) {
                      cmv.champs.headings[index]+=', '+cmv.champs.datos[index].format(Date.patterns.LongDate);
                    });
                    cmv.menu.wrc.add(new cmv.champs.Panel({},cmv.champs.headings,cmv.champs.actids,yr,yr-100));
                })
            }
        }
    }
});
