PDA

View Full Version : Getting 'Uncaught TypeError: object is not a function' in chrome



dhiraj17
10 Apr 2012, 2:42 AM
Here is my view code:



var editor = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 1
});


editor.on({
scope: this,
afteredit: function (roweditor, changes, record, rowIndex) {
alert(record);
}
});


Ext.define('Employee.view.EmpList', {
extend: 'Ext.grid.Panel',
alias: 'widget.EmpList',
store: 'Employees',
title: 'Employees',
id: 'EList',
height: 200,
width: 500,
plugins: [editor],
selType: 'rowmodel',
initComponent: function () {
this.columns = [
{ header: 'Employee ID', dataIndex: 'EmpID', flex: 1, hidden: true },
{ header: 'First Name', dataIndex: 'FirstName', flex: 1, editor: { allowblank: false} },
{ header: 'Last Name', dataIndex: 'LastName', flex: 1, editor: { allowblank: false} },
{ header: 'Email', dataIndex: 'Email', flex: 1, editor: { allowblank: false, vtype: 'email'} }
];


this.callParent(arguments);
}
});


This code works fine in Firefox but its doesnot work in chrome. If comment the editor n take out the plugin line from grid it works fine in chrome as well. Also if use ext-all.js instead of ext-debug.js then it works fine as well. I get this error:


Uncaught TypeError: object is not a function

(anonymous function)
Ext.ClassManager.instantiateext-debug.js:6634 (http://localhost:1856/ext-4.0/ext-debug.js)
(anonymous function)ext-debug.js:2448 (http://localhost:1856/ext-4.0/ext-debug.js)
(anonymous function)EmpList.js:1 (http://localhost:1856/employee/view/EmpList.js?_dc=1334053020027)


Also when i edit the record when the code works i.e in firefox then i get the 'record' as undefined.

scottmartin
10 Apr 2012, 6:55 AM
See if this will work better for you:



var editor = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 1,
listeners: {
afteredit: function (roweditor, changes, record, rowIndex) {
alert(record);
}
}
});


Regards,
Scott.

dhiraj17
10 Apr 2012, 8:39 PM
Thanks for the reply Scott. I tried your solution bt this still do not solve any of the problems.

lqjack
16 May 2012, 12:34 AM
first you should clean you cache,<br>then ,<br>&nbsp;if you use Ext.create() before ,some time the store cause the problem