Note that there are some explanatory texts on larger screens.

plurals
  1. POSencha ExtJS 4 Linked Combobox Issue
    primarykey
    data
    text
    <p>I'm experimenting what seems to be a bug in ExtJS 4 Combobox AJAX Store.</p> <p>I have a grid with articles, each <strong>article</strong> has a <strong>supplier</strong> and a <strong>category</strong>, each <strong>supplier</strong> offer articles that belong to a certain <strong>category</strong>. In order to filtre the grid i've put 2 Combos(Select Lists). One for <strong>supplier</strong> and one for <strong>category</strong>. These combos get their values by AJAX from a php script.</p> <p>Everything went good till i tried to link the combos like this:</p> <p>When the user selects a <strong>category</strong> from the combobox, the <strong>supplier</strong> Store refreshes with suppliers that offer that category (works fine!).</p> <p>The the user selects a <strong>supplier</strong> from the combobox, and the <strong>category</strong> Store refreshes(refresh is good, as seen with firebug). </p> <p>Here is my issue now, if the user selects the <strong>category</strong> combobox again it, the loading mask doesn't go away so it can't change the value of the combo. </p> <p>I've tested and the AJAX is working fine, it's just a EXTJS 4 issue with the Loading Mask.</p> <p>The issue is happening both ways: </p> <p><strong>A)</strong></p> <p><strong>1.</strong> User selects a category </p> <p><strong>2.</strong> User selects a supplier</p> <p><strong>3.</strong> User CAN'T select a category(loading mask doesn't go away)</p> <p><strong>AND</strong></p> <p><strong>B)</strong></p> <p><strong>1.</strong> User selects a supplier</p> <p><strong>2.</strong> User selects a category</p> <p><strong>3.</strong> User CAN'T select a supplier(loading mask doesn't go away)</p> <p><strong>EDIT:</strong></p> <p>The problem seems to also occur on these situation(and vice-versa: supplier->category)</p> <p><strong>1.</strong> User selects a category</p> <p><strong>2.</strong> User changes the category</p> <p><strong>3.</strong> User CAN'T select a supplier(loading mask doesn't go away)</p> <p>Here are my models:</p> <pre><code> Ext.define('Category', { extend: 'Ext.data.Model', fields: [ { name: 'name'}, { name: 'id'} ] }); Ext.define('Supplier', { extend: 'Ext.data.Model', fields: [ { name: 'name'}, { name: 'id'} ] }); </code></pre> <p>Here are my stores:</p> <pre><code> var categoryStore = Ext.create('Ext.data.Store', { model: 'Category', autoLoad: true, remoteSort: true, proxy: { type: 'ajax', url: 'GetCategorysForSupplier', reader: { type: 'json', root: 'items' }, extraParams: { supplier: 0 } } }); var supplierStore = Ext.create('Ext.data.Store', { model: 'Supplier', autoLoad: true, remoteSort: true, proxy: { type: 'ajax', url: 'getSuppliersForCategory.php', reader: { type: 'json', root: 'items' }, extraParams: { category: 0 } } }); </code></pre> <p>And here are my combos:</p> <pre><code> var categoryFilterCombo = Ext.create('Ext.form.field.ComboBox', { xtype: 'combo', store: categoryStore, displayField: 'name', valueField: 'id', fieldLabel: 'Category Filter', listeners: { change: function(field,newVal) { if (Ext.isNumeric(newVal)) { supplierStore.proxy.extraParams.category = newVal; articleStore.proxy.extraParams.category = newVal; supplierStore.load(); articleStore.load(); } } } }); var supplierFilterCombo = Ext.create('Ext.form.field.ComboBox', { store: supplierStore, displayField: 'name', queryMode: 'local', valueField: 'id', fieldLabel: 'Supplier Filter', listeners: { change: function(field,newVal) { if (Ext.isNumeric(newVal)) { categoryStore.proxy.extraParams.supplier = newVal; articleStore.proxy.extraParams.supplier = newVal; categoryStore.load(); articleStore.load(); } } } }); </code></pre> <p>Kind Regards,</p> <p>Dan Cearnau</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload