1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    17
    Vote Rating
    0
    manuelhitz is on a distinguished road

      0  

    Default how to define custom Ext.data.Types?

    how to define custom Ext.data.Types?


    I'm trying to define a custom Ext.data.Types type like explained on http://docs.sencha.com/touch/2-0/#!/api/Ext.data.Types


    Ext.data.Types.SEATCATEGORY = {
    convert: function(v) {
    ...
    },
    // TODO: supposed to use sortType, but doesn't work?!?
    sorterFn: function(rec1, rec2) {
    ...
    },
    type: 'SeatCategory'
    };


    But I get an "Uncaught TypeError: Cannot set property 'SEATCATEGORY' of undefined" error. Like Ext.data.Types isn't defined yet. I'm actually trying to migrate a Sencha Touch 1 app to Sencha Touch 2. It's more compliated than expected )

  2. #2
    Sencha User
    Join Date
    Dec 2010
    Posts
    17
    Vote Rating
    0
    manuelhitz is on a distinguished road

      0  

    Default please update the docs!

    please update the docs!


    ok. Doing it like that works, but please update the docs:

    Ext.apply(Ext.data.Types, {
    SEATCATEGORY: {
    convert: function(v) {
    ...
    },
    // TODO: supposed to use sortType, but doesn't work?!?
    sorterFn: function(rec1, rec2) {
    ...
    },
    type: 'SeatCategory'
    }
    });

    as seen on http://www.sencha.com/forum/showthre...Ext.data.Types