Please ignore the line with the delete button. I just uncommented it out
before I sent it, and it is incorrect. Ignoring that line, the rest of
the code worked fine in CF 10.
On 3/4/15 10:10 PM, Mike Staver wrote:
I wrote some code a few years back, and I have very little ExtJS
coding experience outside of using what shipped with CF 9 & 10. I was
disappointed to discover that most of one of my pages was broken via
the upgrade to CF 11. I did some digging, and discovered that CF 11
ships with ExtJS 4.1. I don't remember what CF 10 was running, but
this code used to work that is associated with a CFGrid object:
// add the 2 custom buttons to the toolbar and init the grid
listener
function init() {
Ext.onReady(function () {
var grid = ColdFusion.Grid.getGridObject("Players");
var tbar = ColdFusion.Grid.getTopToolbar('Players');
tbar.add({xtype: 'button', text: "Add Player",
handler: onAdd });
tbar.add({xtype: 'tbseparator'});
tbar.add({xtype: 'tbfill'});
tbar.addButton({xtype:'button', text:"Delete Player",
handler:onDelete });
ColdFusion.Grid.showTopToolbar('Players');
grid.addListener("rowdblclick", showEditWin);
})
}
The part that doesn't work is the listener for the double clicking of
rows. Basically, nothing happens now when I double click a row. I've
searched for 2 days now trying to wrap my head around the Ext
documentation to understand what I'm doing wrong. No errors are thrown
on the JS console, but nothing happens either. I've found this:
http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.grid.Panel
They show the addListener function, and to be honest, I'm not sure
what has changed about it or what I'm currently doing wrong. Does
anything obvious jump out to anyone?