PDA

View Full Version : Enable/Disable 'grouped' property in List after creation ?



bk.dbe
6 Sep 2011, 8:41 AM
Hi all,

I'm working with Sencha Touch 1.1.0, and I have an issue with the List component and the grouped property.
I have a store which is plugged on my list, and rows are grouped with a particular field : works perfectly. But I would be able to programmatically disable grouping (when a user click on a button for example), after the list is created and rendered.

I tried to set the grouped property to false in my handler and refresh the view after (see the code below), but it doesn't work : group header are still there (without text) and I have no more data.

// Not working
disableListGrouping: function() {
var list = Ext.getCmp('operationList');
list.setLoading(true);
list.grouped = false;
list.refresh();
list.setLoading(false);
}
Is there any way to disable/enable grouping in List after it is created ? Any feature like setGrouped(boolean) ?

Thanks!

bk.dbe
20 Sep 2011, 11:49 PM
Hello again,

I found a fallback for my issue : each time I want to disable/enable the group feature in my list, I recreate it with the corresponding configuration.
So, I have 2 list configurations : one with the 'grouped' attribute as true, the other one without it. And a play with it.

But methods like disableGroup() and enableGroup() would be very useful. Hope they will be in the future.