I am an Ext.Newb, and I've been killing myself on trying to figure this out. I'm actually having a couple different problems...
Edit: I should probably mention that we're using Ext v2.2.0...
First Problem:
I have a TreePanel with two tiers. The first tier are the itemNodes, and we limit this to 25 rows.
However, each itemNode could have thousands of children, so I am adding custom server-side pagination. I've added scroll buttons (images) to the itemNodeUI, and click handlers which call the following function:
Code:
onPaginationNextButtonClick: function(e,t) {
var parentEl = Ext.get(t).findParentNode('.x-tree-node-ct', 10, false).previousSibling;
var treeNodeId = parentEl.getAttribute('ext:tree-node-id');
var treeNode = this.tree.getNodeById(treeNodeId);
var currentPage = parseInt(treeNode.attributes.pageNumber);
treeNode.attributes.pageNumber = currentPage + 1;
treeNode.reload();
}
The tree loader pulls the pageNumber from the itemNode's attributes, and it's sent along with the baseParams to our php file, which then just adds "LIMIT" to the end of the SQL query. Pretty simple really, and it works great.
But here's the problem: The itemNodeUI doesn't seem to be refreshed, so the text that shows how many results are being displayed, and the right/left scroll arrows, is not being updated like it should.
So what I need to do here is, update the children (like I am above), and update the node itself so that the text and scroll arrows are updated. I tried using treeNode.parentNode.reload(), but all that did was reload the entire tree.
Any suggestions on how I can update this node?
Second Problem:
We also need to do filtering. I added two checkboxes to the itemNodeUI, and the plan is to add another click handler to each, which sets an attribute on the itemNode. Again, this will be passed through with the baseParams.
However, the problem is this: When I click on either of these checkboxes, I get the following error in FireBug:
Code:
node is null
node.ui.onCheckChange(e); ext-all-debug.js (line 22852)
This is the code from that particular section of the ext file:
Code:
onCheckboxClick : function(e, node){
node.ui.onCheckChange(e);
}
I've tried adding my own 'onCheckboxClick' to override it, but it didn't work.
Is there a way that I can disable or override this somehow, so I can stick my own handler onto the checkboxes? This seems to me like it would be an easy fix, but it eludes me!
Thanks in advance for your help!