1. #1
    Ext User
    Join Date
    Apr 2009
    Location
    Budapest
    Posts
    7
    Vote Rating
    0
    Valetudo is on a distinguished road

      0  

    Question Grid.RowEditor update: "form.getAttribute is not a function"

    Grid.RowEditor update: "form.getAttribute is not a function"


    Hi!

    This grid fire a "form.getAttribute is not a function" error message when i hit the update button.

    /*Ext JS Library 3.0.3*/

    ext-all-debug.js (line 36200)

    Code:
     if (this.fireEvent('beforecall', this, t) !== false) {
        Ext.Direct.addTransaction(t);
        var isUpload = String(form.getAttribute("enctype")).toLowerCase() == 'multipart/form-data',
    Code:
    Shop.Types.GridDatas = Ext.extend(Ext.grid.GridPanel, {
        title: 'Multi Language Datas',
        margins: '0 5 5 5',
        viewConfig: {
            autoFill: true
        },
        stripeRows: true,
    
        initComponent: function () {
            var writer = new Ext.data.JsonWriter({
                encode: false
            });
            var ds = new Ext.data.DirectStore({
                api: {
                    read: Type.Details,
                    create: Type.Create,
                    destroy: Type.Delete,
                    update: Type.Update
                },
                writer: writer,
                paramsAsHash: true,
                paramOrder: 'id',
                baseParams: {
                    id: 0
                },
                root: 'data',
                idProperty: 'Id',
                totalProperty: 'total',
                fields: [{
                    name: 'typed_id',
                    type: 'int'
                },
                {
                    name: 'lang_id',
                    type: 'int',
                    mapping: 'lang_id'
                },
                {
                    name: 'language',
                    type: 'string',
                    mapping: 'language.language_short'
                },
                {
                    name: 'type_name',
                    type: 'string'
                },
                {
                    name: 'type_name_flural',
                    type: 'string'
                }],
                remoteSort: false
            });
    
            var editor = new Ext.ux.grid.RowEditor({
                saveText: 'Update'
            });
    
            var config = {
                store: ds,
                plugins: [editor],
                autoExpandColumn: 'blank',
                columns: [
                new Ext.grid.RowNumberer(), {
                    header: 'Language',
                    dataIndex: 'language',
                    width: 85,
                    align: 'center'
                },
                {
                    header: 'Name',
                    dataIndex: 'type_name',
                    width: 200,
                    editor: {
                        xtype: 'textfield',
                        allowBlank: false
                    }
                },
                {
                    header: 'Name Flural',
                    dataIndex: 'type_name_flural',
                    width: 200,
                    editor: {
                        xtype: 'textfield',
                        allowBlank: false
                    }
                },
                {
                    id: 'blank',
                    dataIndex: ''
                }]
            };
    
            Ext.apply(this, Ext.apply(this.initialConfig, config));
    
            Shop.Types.GridDatas.superclass.initComponent.apply(this, arguments);
        },
    
        loadDatas: function (id) {
            this.getStore().setBaseParam('id', id);
            this.getStore().reload();
    
            Shop.Types.GridDatas.superclass.afterRender.apply(this, arguments);
        }
    });
    With this code -> console : "create",.....

    Code:
    api: {
        read: Type.Details,
        create: function (params, proxy) {
            console.log("create", params);
        },
        destroy: Type.Delete,
        update: function (params, proxy) {
            console.log("update", params);
        }
    }
    What is wrong with my code?

    Sorry for my English!

    Thx!

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,185
    Vote Rating
    63
    aconran is just really nice aconran is just really nice aconran is just really nice aconran is just really nice aconran is just really nice

      0  

    Default


    Looks like you have formHandler set to true on your Ext.Direct api (on the server-side).

    Ext is trying to submit a form that doesn't exist.
    Aaron Conran
    @aconran
    Sencha Architect Development Team