PDA

View Full Version : [FIXED] 2.1.0-rc2 NestedList Grouped and Grouper no longer work



drb
30 Oct 2012, 3:27 PM
Touch 2.1.0-rc2

In 2.0.1.1 in the NestedList listchange event it is possible to set up a Grouped on the List and a Grouper on the list.getStore().

This no longer works in 2.1.0-rc2



Ext.setup({
onReady: function () {

var data = {
text: 'Groceries',
items: [{
text: 'Drinks',
gp: 'D',
items: [{
text: 'Water',
gp: "W",
items: [{
text: 'Sparkling',
gp: "S",
leaf: true
}, {
text: 'Still',
gp: "S",
leaf: true
}, {
text: 'Deep',
gp: "D",
leaf: true
}, {
text: 'Muddy',
gp: "M",
leaf: true
}]
}, {
text: 'Ale',
gp: 'A',
leaf: true
}]

}, {
text: 'Lager',
gp: "L",
leaf: true
}]
};

Ext.define('ListItem', {
extend: 'Ext.data.Model',
config: {
fields: [{
name: 'text',
type: 'string'
}, {
name: 'gp',
type: 'string'
}]
}
});

var store = Ext.create('Ext.data.TreeStore', {
model: 'ListItem',
defaultRootProperty: 'items',
root: data
});

var nestedList = Ext.create('Ext.NestedList', {
fullscreen: true,
title: 'Groceries',
displayField: 'text',
store: store,
listeners: {
listchange: function (nlist, list) {
var liststore = list.getStore();
liststore.setGrouper({
groupFn: function (record) {
return record.get("gp");
}
});
list.setGrouped(true);
}
}

});
}
});


Thanks
David

mitchellsimoens
30 Oct 2012, 4:19 PM
Thanks for the report! I have opened a bug in our bug tracker.