Results 1 to 3 of 3

Thread: this.ds is undefined

  1. #1

    Default this.ds is undefined

    Hi,
    I have created gridpanel but whenver I set this grid in form's Item property it shows error like:

    "this.ds is undefined
    var state = this.ds.getSortState();"

    My code is as follows:

    Code:
    var winRoleRegister;
    var frmRoleRegister;
    var rolegrid;
    Ext.onReady(function() {
        Ext.QuickTips.init();
        gridstore = new Ext.data.JsonStore({
        url : 'role.action?type=module',    
        remoteSort : false,
        root : 'list',
        idProperty : 'id',
        fields : ['modname'],
        autoLoad : true
    });
        rolegrid = new Ext.grid.GridPanel({
            store:'gridstore',
            columns:
                [{ header:'Modules',
                    dataIndex:'modname'
                    
                  }
    
                 ]
        });
         frmRoleRegister = new Ext.FormPanel({
                // url:'UserRegistration.action',
                // method:'POST',
                frame : false,
                border : false,
                //reader:reader,
                buttonAlign : 'center',
                bodyStyle : 'cellpadding:15px 15px 20px 15px 15px;',
                width : 430,
                labelWidth : 160,
                id : 'frmRoleRegister',
                items : [rolegrid],
                buttonAlign : 'center',
                buttons : [{
                    text : '<font color=#15428B size=2><b>Submit</b></font>',
                    id:'rolereg',
                    handler : function() {
                        var btntext = Ext.getCmp('rolereg').getText();
                        alert(btntext);
                        if(btntext == 'Update')
                        {
                            frmRoleRegister.getForm().submit({
                        //url :'role.action?type=update',
                        method : 'POST',
                        //params:{getrole:vname},
                        waitTitle : 'Checking',
                            waitMsg : 'Validating ....',
                            success : function() {
                                Ext.Msg.alert('Registration Successful',
                                        'Role has been successfully registered');
                                   });
                            },
                            failure : function(form, action) {
                                if (action.failureType == 'server') {
                                    Ext.Msg.alert('Error','Registration failed due to server error');
                                } else { // formRegister.getForm().submit();
                                    Ext.Msg    .alert('Registration Failed','Email Id already exist or Manadatory fields are left unfilled !!!');
                                    formRegister.getForm().reset();
                                }
    
                            }
                        
                            });
                        }
                        else
                        {
                            frmRoleRegister.getForm().submit({
                        //url :'role.action?type=register',
                        method : 'POST',
                            waitTitle : 'Checking',
                            waitMsg : 'Validating ....',
                            success : function() {
                                Ext.Msg.alert('Registration Successful',
                                        'Role has been successfully registered');
    
                            },
                            failure : function(form, action) {
                                if (action.failureType == 'server') {
                                    Ext.Msg.alert('Error','Registration failed due to server error');
                                } else { // formRegister.getForm().submit();
                                    Ext.Msg    .alert('Registration Failed','Email Id already exist or Manadatory fields are left unfilled !!!');
                                    formRegister.getForm().reset();
                                }
    
                            }
                        });
                            
                        }
                        
                    }
                }
    
                ]
            });
    
            
            // 01. Window Register
            winRoleRegister = new Ext.Window({
                title : '<font color=#15428B size=4><b><center>Role Registration</center></b></font>',
                id : 'winRoleRegister',
                layout : 'fit',
                width : 410,
                height : 180,
                // y: 120,
                resizable : false,
                closable : false,
                items : [frmRoleRegister]
            });
    });   //end of onready
    Please if somebody can help me on this issue..

    Thanks,
    Komal
    Last edited by Condor; 27 Dec 2010 at 3:44 AM. Reason: Please post using [CODE] tags!

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    You want store:gridstore and not store:'gridstore'.

  3. #3

    Default Thanks

    Thanks a lot......
    I had done such a silly mistake...
    thanks once again...

Similar Threads

  1. sp is undefined
    By ushangar in forum Ext 2.x: Help & Discussion
    Replies: 14
    Last Post: 20 Aug 2013, 6:22 AM
  2. Ext.EventObject is undefined + Ext.BoxComponent is undefined
    By rgamero in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 18 May 2010, 1:33 PM
  3. this.ds is undefined
    By Stephan123 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 25 Sep 2009, 1:02 AM
  4. cm is undefined
    By csextjs in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 14 Apr 2009, 7:27 PM

Posting Permissions

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