Results 1 to 5 of 5

Thread: Combobox selection cause popup window to close (why?)

  1. #1

    Default Combobox selection cause popup window to close (why?)

    I have a pop-up window (Ext.window.Window) with a form on it. Within the form are two comboboxes. When a selection is made in either of the comboboxes, the pop-up window disappears. The form data is not submitted, however. I don't want the combobox selection to cause this "closing" of the popup. Is there a setting in thru Sencha Architect that prevents this behavior.

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    Impossible to say without seeing any code, certainly not normal behaviour.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3

    Default

    Here is the main code (starting with Ext.define...), which is mostly generated by Architect, but some of my settings are probably suspect. I'm new to Sencha Architect and EXTJS (1 week). Also the Ext.window is launched by this editSiteInfo function (in bold) on a double click on a grid:

    editSiteInfo: function(grid, record) {
    var view = Ext.widget('EditSite');
    var frm = view.down('form');


    frm.loadRecord(record);
    var cmbStates = view.down('#cmbStates');
    cmbStates.setValue(record.data.State);
    var cmbCountries = view.down('#cmbCountries');
    cmbCountries.setValue(record.data.Country);

    Ext.define('MyApp.view.EditSite', {
    extend: 'Ext.window.Window',
    alias: 'widget.EditSite',


    autoRender: false,
    autoShow: true,
    height: 226,
    id: 'EditSite',
    width: 372,
    title: 'Edit Site Info',


    initComponent: function() {
    var me = this;


    Ext.applyIf(me, {
    dockedItems: [
    {
    xtype: 'form',
    dock: 'top',
    items: [
    {
    xtype: 'textfield',
    id: 'Sitename',
    width: 350,
    name: 'Sitename',
    fieldLabel: 'Sitename',
    labelAlign: 'right'
    },
    {
    xtype: 'textfield',
    id: 'Address',
    width: 350,
    name: 'Address',
    fieldLabel: 'Address',
    labelAlign: 'right'
    },
    {
    xtype: 'textfield',
    id: 'City',
    width: 350,
    name: 'city',
    fieldLabel: 'City',
    labelAlign: 'right'
    },
    {
    xtype: 'combobox',
    autoShow: true,
    id: 'cmbStates',
    width: 350,
    name: 'cmbStates',
    fieldLabel: 'State',
    labelAlign: 'right',
    displayField: 'name',
    store: 'StateStore',
    typeAhead: true,
    valueField: 'abbr'
    },
    {
    xtype: 'textfield',
    id: 'PostalCode',
    width: 350,
    name: 'postalcode',
    fieldLabel: 'Postal code',
    labelAlign: 'right'
    },
    {
    xtype: 'combobox',
    autoShow: true,
    id: 'cmbCountries',
    width: 350,
    name: 'cmbCountries',
    fieldLabel: 'Country',
    labelAlign: 'right',
    displayField: 'name',
    queryMode: 'local',
    store: 'CountryStore',
    typeAhead: true,
    valueField: 'country'
    }
    ],
    dockedItems: [
    {
    xtype: 'toolbar',
    border: '3 3 3 3 ',
    autoDestroy: false,
    dock: 'bottom',
    layout: {
    pack: 'end',
    type: 'hbox'
    },
    items: [
    {
    xtype: 'button',
    handler: function(button, event) {
    var form = me.down('form').getForm();
    var data = form.getValues();
    form.submit({url: 'OData/UpdateSiteInfo/' + data ,
    submitEmptyText: false,
    waitMsg: 'Saving Data...'});
    me.close();
    },
    height: 25,
    id: 'btnSave',
    width: 50,
    text: 'Save'
    },
    {
    xtype: 'button',
    handler: function(button, event) {
    me.close();
    },
    height: 25,
    id: 'btnCancel',
    width: 50,
    text: 'Cancel'
    },
    {
    xtype: 'hiddenfield',
    id: 'SiteId',
    name: 'SiteId',
    fieldLabel: 'Label'
    }
    ]
    }
    ]
    }
    ]
    });


    me.callParent(arguments);
    }

    For what it is worth, it seems the ComboBoxes are re-loading data from their stores when selected.

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892
    Answers
    41

    Default

    Try removing autoShow: true

    I just fixed a bug with that. I think it will be rendering that Component which is a Very Bad Thing.

  5. #5

    Default

    Unfortunately, removing the autoshow did not fix anything. Of course to see the popup window I had to change the code that launches the window using the show() method. Is there some other method I should be using to launch theis popup window?

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
  •