Results 1 to 3 of 3

Thread: form.Panel loadRecord error

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Location
    Chicago, IL
    Posts
    6

    Default form.Panel loadRecord error

    I have an Ext.grid.Panel where an item selection causes a modal Window with a form.Panel item to be presented. All is well the first time a record is selected, but all subsequent selections result in the following error.NOTE: The record is successfully loaded into the form, but the window position is no longer rendered. I want to get rid of the error and figure out the cause. Could someone please assist me in figuring out the problem?

    The abbreviated object definition is as follows:
    Ext.define('UserGrid', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.usergrid',

    title: 'Users',
    autoScroll: true,
    initComponent: function(){
    Ext.apply(this, {
    store: {
    autoLoad: true,
    //autoSync: true,
    model: 'User',
    listeners: {
    load: function() {
    Logger.log('User store loaded', false);
    }
    }
    },
    columns: [{
    ...
    dockedItems: [{
    xtype: 'toolbar',
    items: [{
    itemId: 'load',
    text: 'Load Users',
    scope: this,
    handler: this.loadUsers,
    disabled: true
    },{
    itemId: 'adduser',
    text: 'Add User',
    scope: this,
    handler: this.addUser,
    disabled: false
    }]
    }]
    });
    this.callParent();
    this.getSelectionModel().on('selectionchange', this.onSelectChange, this);
    },



    onSelectChange: function(selModel, selections) {
    var user_form_panel;
    user_form_panel = Ext.create('widget.userform', {
    scope: user_form_panel,
    autoDestroy: true,
    listeners: {
    'afterrender': function() {
    record = selections[0];
    if (record != undefined && record != null) {
    this.getForm().loadRecord(record);
    }
    }
    }
    });
    // This just creates a window to wrap the login form.
    // The login object is passed to the items collection.
    var win = new Ext.Window({
    layout:'fit',
    width:500,
    height:250,
    closable: true,
    closeAction: 'destroy',
    resizable: false,
    plain: true,
    modal: true,
    border: false,
    items: [user_form_panel]
    });
    win.show();
    },
    loadUsers: function(){
    var rec = this.active,
    name = rec.get('username'),
    owner = this.ownerCt;
    alert(name);
    },
    addUser: function () {
    alert('Not Implemented');
    }
    });
    Last edited by carmelchas; 21 Nov 2011 at 2:28 PM. Reason: adding a note about the behavior.

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Location
    Chicago, IL
    Posts
    6

    Default ComboBox is the culprit

    I commented-out the ComboBox for role and the problem goes away. I am still investigating the specifics of why this is happening. If anyone has a clue, please let me know.

    --Chas

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    22

    Default

    I am curious if you were aver able to resolve the problem. I am seeing a similar issue with the combo-box and would love to know if there is a solution.

Tags for this Thread

Posting Permissions

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