I have checked the API and is supposed to exist a method from GridPanel that is addLister, so ok I try to use it:
function showCreatePatientCoincidencesWindow(matches, patientData, actuallyCreate) {
var grid = new GridPanel('idGrid', '', null, 250);
grid.addColumn(new GridColumn('idgridColumn0LC', 'Nombre', "cName"));
grid.addColumn(new GridColumn('idgridColumn1LC',' Apellido1', "cSurname1"));
grid.addColumn(new GridColumn('idgridColumn2LC', 'Apellido2', "cSurname2"));
grid.addColumn(new GridColumn('idgridColumn3LC', 'Documento', "cDoc"));
grid.addColumn(new GridColumn('idgridColumn4LC', 'Fecha Nacimiento', "cDate"));
grid.addColumn(new GridColumn('idgridColumn5LC', 'Sexo', "cGender"));
grid.addListener('show',showHandler,this);
var gridStore = new Ext.data.GroupingStore({
root:'matches',
reader: new Ext.data.JsonReader({
.
.
.
.
The code before is the one I’m executing, it obviously continue but the problem is that I get this error from chrome debugger:
Uncaught TypeError: Object #GridPanel has no method ‘addListener’
How is it possible? what I’m doing wrong? My library is the 3.4 and I have check the APIs of Ext JS 2.3, 3.4 and 4.1, all of them have this method.
Your gridpanel constructor is not formatted properly per the 3.4 docs.
There should only be a single argument which is a config object (i.e. with config keys and wrapped in curlies
{}).Also full names are customary
Ext.grid.GridPanelvsGridPanel. I think you can get around that if you are requiring theExt.grid.GridPanel.jsin your JS but I can’t tell if you are doing that.I probably do not have your arguments mapped to the right configs correctly, but this should give you an idea:
You may also want to define the columns and store in the constructor while your at it: