View Full Version : TreePaging toolbar

28 Oct 2011, 6:09 AM
Hi all.

If anybody is interested I've prepared the TreePaging toolbar.

It can be used similar to grid Paging toolbar (I've based on its code and simply copied about 80% of code).

The only difference is it requires the grid not the store passed as config.

Config example in TreePanel:

initComponent : function() {
var me = this;
me.dockedItems = [
{xtype : 'treepagingtoolbar', grid : me, dock : 'bottom', displayInfo : true}

Paging is done per each node - not the whole tree. You can refresh selected node or whole tree (root node). I was inspired by Maxim Bazhenov's (Ext.ux.maximgb.tg) extension for ExtJs 3.

There is required to overwrite AbstractStore and TreeStore classes with code in attachement to work properly. It contains some custom fixes which are described in http://www.sencha.com/forum/showthread.php?151211-Reloading-TreeStore-adds-all-records-to-store-getRemovedRecords&p=664477&viewfull=1#post664477 thread.


Do not hesitate to make any improvements, better codding, etc. if have time for it ;) I am not a JavaScript programmer B).

13 Dec 2011, 10:38 AM
I've implemented this, but there still seems to be a problem with duplicate nodes in the tree, which is causing the updateIndexes function in Ext.view.AbstractView to fail. Specifically, the property this.all.elements at that point, contains two copies of each node (6 in total), while the call to this.store.getRange() return only the three individual records.

13 Dec 2011, 11:29 AM
also, what is the format of the data expected for the store? Where is the "total" property expected?

14 Dec 2011, 3:54 AM
What version of ExtJS do you use? It has been tested with 4.0.6 and 4.0.7 only.
And have you done all store (abstract and tree) classes overwrite?

Data format is as for TreeStore, nothing special.
New page request works as node collapse, subnodes remove and node expand with parameter (page). Request MUST return only subnodes of specified node (for given page) - not all tree. When request returns nodes which are in the tree already then you have duplicates. Maybe this is the case?

24 Jul 2012, 5:56 PM
this extension is not working properly with 4.1 Any plans to update it?