extjs - Sencha Touch : dynamically update grouper function -
i have sencha touch 2.3 app has list grouped-
grouped: true,
the grouper function defined in store -
grouper: { groupfn: function(record) { homecoming record.get('name'); } }
all works fine. now, during runtime, want update grouper function, eg: grouping other record attribute location
how do dynamically?
i plan update grouper function when user taps button (eg: user wants see list of records grouped location)
how accomplish this?
i believe can utilize setgrouper method provided store class : http://docs.sencha.com/touch/2.3.2/#!/api/ext.data.store-method-setgrouper
you need specify gouper 1 time again :
yourstore.setgrouper({ groupfn : function(record) { homecoming record.get('location'); } });
you may have refresh list manually, don't think there event fired change, , caught list repaint.
extjs sencha-touch sencha-touch-2 grouping sencha-touch-2.1
No comments:
Post a Comment