PDA

View Full Version : Nedd Tree structure



salmondavid888
23 Dec 2010, 7:08 AM
Hi,
currently i am using EditorGrid with ListStore. i am able to implement local pagination. here the problem is for obtaining Tree structure we have to use TreeStore. but for treestore paging loader may not support. please suggest me which grid and which store i need to use to obtain tree structure. please find the code currently i am using for local pagination with EditorGrid and ListStore.

PagingModelMemoryProxy proxy = new PagingModelMemoryProxy(results);
PagingLoader loader = new BasePagingLoader(proxy);
loader.setRemoteSort(true);
ListStore<DataModel> employeeList = new ListStore<DataModel>(loader);
private EditorGrid<DataModel> grid = new EditorGrid<DataModel> (employeeList,columnmodel)
PagingToolBar toolBar = new PagingToolBar(30);
toolBar.bind(loader);
loader.load(0, 30);


Thanks!

sven
23 Dec 2010, 7:14 AM
Do you need to have expand/collapse features or are you only looking for correct indenting?

salmondavid888
23 Dec 2010, 7:20 AM
Hi Sven,

expand and collpase are not required. only indentation is required. but there should parent and child relation ship among the records.

Thanks!

sven
23 Dec 2010, 7:21 AM
Well, you can use ListStore and LIveGridView than in a normal Grid. Save the indent in your model, also implement correct sorting, so relationships are mantained. A custom GridCellRenderer would than renderer the correct icon and the indent as needed.

salmondavid888
23 Dec 2010, 7:33 AM
Hi Sven,
How can we manage relationship with ListStore? assume i have 200 records i want to keep every 2nd records inside 1st record. please tell me how it is possbile?

Thanks!

sven
23 Dec 2010, 7:34 AM
Sorting just needs to be in a way, that everything is in the order how it would look like in a TreeGrid if everything is expanded. That is all.

The GridCellRenderer would indent it than correctly as needed (indenting is saved in the model).

I am using this approach for a couple of my customers without any problems.

salmondavid888
23 Dec 2010, 7:36 AM
Thanks..Sven...