Results 1 to 6 of 6

Thread: ERROR (MVC) : DATA.STORE ERROR ON GRID PANEL

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    15

    Default ERROR (MVC) : DATA.STORE ERROR ON GRID PANEL

    I get an error when I use data.store to grid.panel in the MVC, the error message is "Uncaught TypeError: Can not read property 'isBufferedStore' of undefined" how to fix this.

    this is my controller
    Code:
    Ext.define('Ext5Yii2.controller.admin.Roles', {
        extend: 'Ext.app.Controller',
        requires: [],
        views: [
            'admin.roles.Panel',
            'admin.roles.Group'
        ],
        stores: [
            'admin.roles.Group'  
        ],
        refs: [
            {
                ref: 'Panel',
                selector: 'AdminRolesPanel'
            }
        ]
    });
    this is my model
    Code:
    Ext.define('Ext5Yii2.model.admin.roles.Group', {
        extend  : 'Ext.data.Model',         
        fields  : [
            {name:'id', type:'float'},
            {name:'name', type:'string'},
            {name:'note', type:'string'},
            {name:'publish', type:'boolean'},
            {name:'store_name', type:'string'},
            {name:'created_date', type:'string'},
            {name:'user_name', type:'string'},
            {name:'user_id', type:'string'},
            {name:'store_id', type:'string'}
        ]
    });
    this is my store
    Code:
    Ext.define('Ext5Yii2.store.admin.roles.Group', { 
        extend: 'Ext.data.Store',  
        model: 'Ext5Yii2.model.admin.roles.Group',
        autoLoad: true,
        remoteSort: true,
        remoteFilter: true,
        pageSize:   50,
        proxy: {
            type: 'ajax',
            api: {                   
                read: 'admin/roles/read'
            },
            actionMethods: {      
                read   : 'POST'
            },
            reader: {
                type: 'json',
                rootProperty: 'data',
                messageProperty:'error',
                successProperty:'success',
                totalProperty:'total'
            },    
            listeners : {
                exception: AjaxException2
            }
        }
     })
    this is my grid panel view
    Code:
    Ext.define('Ext5Yii2.view.admin.roles.Group', {
        extend          : 'Ext.grid.Panel',
        requires: [],
        xtype           : 'AdminRolesGroup',    
        autoScroll      : true,
        store           : 'admin.roles.Group',  
        getGroup : function() {
            return this;
        },
        columns :[
            {
                header: 'NAME',
                dataIndex: 'name',
                flex:1
            },
            {
                header: 'DESCRIPTION',
                dataIndex: 'note',
                flex:1
            }
        ]
    })

    if i am remark code in my view
    Code:
     store  : 'admin.roles.Group',
    or store direct on view is running well

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Answers
    512

    Default

    There's no obvious error in your code. Is the controller listed in controllers:[] array in the application?
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    15

    Default

    Thank you for your response, I do not think there is a controller list in controllers:[] array in the application, rather than with Ext5Yii2.app.getController ('controller name') is enough to call the control. because in the previous version with same method its running well, and one more i am using "Ext.data.TreeStore" for "Ext.tree.Panel" its running well to

    below I show the error message

    2014-07-15_004435.jpg


    can any one to help me??

  4. #4
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Answers
    512

    Default

    For the controller to be loaded in the first place, it must be listed in controllers:[] array either in app.js or in Application.js. If it is not then it is not loaded. So there should be something like: controllers:['admin.Roles']
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    15

    Default

    thx, i got fix this problem. Thank Saki

  6. #6
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Answers
    512

    Default

    Just curious, was it that the controller hadn't been listed in controllers:[] or something else?
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •