Well I made a change that inexplicably fixed the problem. I removed id="{CategoryName}" from this code:
Code:
var template = new Ext.XTemplate(
'<tpl for=".">',
'<div class="category" id="{CategoryName}">',
'<div >{CategoryName}</div>',
'</div>',
'<tpl for="statements">',
'{Text}',
'</tpl>',
'</tpl>');
so it now looks like this:
Code:
var template = new Ext.XTemplate(
'<tpl for=".">',
'<div class="category">',
'<div >{CategoryName}</div>',
'</div>',
'<tpl for="statements">',
'{Text}',
'</tpl>',
'</tpl>');
It now works and I have no idea why. Oh well