if (list) { /*NOTE: have a condition here because I only want the middle nested list to be grouped
remove this if statement and use only the body if you want ALL nested lists to be grouped
*/ if (typeof node.isRoot == 'undefined' && !node.childNodes[0].leaf) { //list.store.groupField = 'Text'; list.store.getGroupString = function (record) { /*IMPORTANT!! depending on what your data type is, this line may need to be changed,
but what you want is to return ONLY THE FIRST LETTER of your text
*/

/*NOTE: have a condition here because I only want the middle nested list to be grouped
remove this if statement and use only the body if you want ALL nested lists to be grouped
*/ if (typeof node.isRoot == 'undefined' && !node.childNodes[0].leaf) { config.store.getGroupString = function (record) { /*IMPORTANT!! depending on what your data type is, this line may need to be changed,
but what you want is to return ONLY THE FIRST LETTER of your text
*/ return record.data.Text[0]; }; config.grouped = true; config.indexBar = true; }
return config;
}
}

1 Dec 2011, 1:41 PM

benwhite

Thanks, this was a great tip...
I changed it just a bit so that it's more reusable.
Here is my code.

This could be optimized a bit, but I wanted to keep the logic the same as the original code to make it easier for others to see what I changed.

21 Dec 2011, 9:37 AM

dbwelch

Can you post entire example?

I'm trying to do the same with a nestedlist, but, don't see how this one function will help, is it possible for you post more of your example code and where the function fits in? Also, I'm using Sench 2.0, not sure if this still applies.

3 Feb 2012, 4:41 AM

falsanu

Problem with changing internal.id

Hi,

i've tried your code and it works quite good, but there is a massive problem when using the Detail-Card. When i click on a leaf i'll get the wrong data for the Detail-Card.

Do you have an idea where this fault happens? I assume that the error happens here:

Code:

itemId = node.internalId;

Thanx for any help.

falsanu.

15 Jun 2013, 1:44 AM

Pulp Fiction

Hi, sorry but this method does not work for me. I am using a JsonP Tree Store: