PDA

View Full Version : this.load is not a function [@RowEditor Grid]



talha06
4 Mar 2010, 2:09 AM
Hello all,

I'm trying to use RowEditor Grid with remote data(from database). But I see an error at Firebug that says:



this.load is not a function
this.load(params, reader, callback, scope, options); ext-all-debug.js (sat?r 35141)

By the way I'm using RowEditor extension. (Ext.ux.RowEditor)
I need your helps.
Thanx in advance.

Here's my code:



Ext.onReady(function() {
Ext.QuickTips.init();

var editor = new Ext.ux.grid.RowEditor({
saveText: 'GŁncelle'
});

var Kisi = Ext.data.Record.create([{
name: 'kisiId',
allowBlank : false
}, {
name: 'kisiAd',
allowBlank : false
}, {
name: 'kisiSoyad',
allowBlank : false
}, {
name: 'kisiYas',
allowBlank : false
},{
name: 'kisiCinsiyet',
allowBlank : false
},{
name: 'kisiMeslek',
allowBlank : false
}]);

var colMod = new Ext.grid.ColumnModel({
defaults : {
sortable : true
},
columns : [
new Ext.grid.RowNumberer(),
{ header : '<b>Ki?i ID</b>', dataIndex : 'kisiId', width : 60, editor : { xtype: 'numberfield', allowBlank:false, width:60 } },
{ header : '<b>Ki?i Ad</b>', dataIndex : 'kisiAd', width : 150, editor : { xtype: 'textfield', allowBlank:false, width:150 } },
{ header : '<b>Ki?i Soyad</b>', dataIndex : 'kisiSoyad', width : 150, editor : { xtype: 'textfield', allowBlank:false, width:150 } },
{ header : '<b>Ki?i Ya?</b>', dataIndex : 'kisiYas', width : 60, editor : { xtype: 'numberfield', allowBlank:false, width:60 } },
{ header : '<b>Ki?i Cinsiyet</b>', dataIndex : 'kisiCinsiyet', width : 150, editor : { xtype: 'textfield', allowBlank:false, width:150 } },
{ header : '<b>Ki?i Meslek</b>', dataIndex : 'kisiMeslek', width : 180, editor : { xtype: 'textfield', allowBlank:false, width:180 } }
]
});

var myProxy = new Ext.data.DataProxy({
method : 'GET' ,
url : 'getKisi'
});

var myReader = new Ext.data.JsonReader({
fields : Kisi,
idProperty: 'id',
root: 'rows',
totalProperty: 'results'

});

var myStore = new Ext.data.JsonStore({
autoDestroy : true,
reader : myReader,
proxy : myProxy,
sortInfo : {
field : 'KisiId',
direction : 'ASC'
},
autoLoad : true
});

var grid = new Ext.grid.GridPanel({
id : 'myGrid',
renderTo : document.body,
frame: true,
border: true,
autoHeight: true,
autoWidth: true,
//width : 600,
title : 'Ki?iler',
//autoExpandColumn: 'KisiAd',
plugins: [editor],
colModel : colMod,
store : myStore,
reader : myReader,
url : myProxy,
tbar : tb
});

var tb = new Ext.Toolbar({
items : [{
iconCls: 'icon-user-add',
text: '<b>Ki?i Ekle</b>',
handler: function(){
var yeniKisi = new Kisi({
KisiId : 0,
KisiAd : 'Ad',
KisiSoyad : 'Soyad',
KisiYas : 0,
KisiCinsiyet : 'Cinsiyet',
KisiMeslek : 'Meslek'
});
editor.stopEditing();
myStore.insert(0, yeniKisi);
grid.getView().refresh();
grid.getSelectionModel().selectRow(0);
editor.startEditing(0);
}
}, {
ref: '../kaldirBtn',
iconCls: 'icon-user-delete',
text: '<b>Ki?i Kald?r</b>',
disabled: true,
handler: function(){
editor.stopEditing();
var s = grid.getSelectionModel().getSelections();
for(var i = 0, r; r = s[i]; i++){
myStore.remove(r);
}
}
}]
}); // eo tbar
});

Animal
4 Mar 2010, 2:32 AM
DataProxy is an abstract class. It does not have a load method.

talha06
4 Mar 2010, 11:14 AM
DataProxy is an abstract class. It does not have a load method.
Thank you so much for your reply..