Search code examples
javascriptsearchextjscomboboxstore

Ext JS: Combobox search error


I've a combobox which connects to DB with AJAX proxy. Questions are;

  • When I type any string into combobox, it removes typed string when XHR loading ends..
  • Secondly even if the searched record available inside request data, it's not displaying!

It's doing correct URL requst with param, typed input already exist in Dataset of XHR response but doesn't bring searched record on selection inside Dropdown list...

http://localhost:PORT/myapp/all/list?_dc=1522929831253&description=Sample&page=1&start=0&limit=1000

The thing is I've another combobox with same configuration and it works perfectly but this one is not! How can I over come this situation? Here are some snippets of combobox;

Combobox:

Ext.define('MyApp.AccCombo',{
    extend:'Ext.form.field.ComboBox',
    xtype:'samplecombo',
    requires: [],
    name: 'Sample Combo',
    fieldLabel: translations.comboDesc,
    displayField:'description',
    valueField:'sameid',

    store: {
        pageSize: 0,
        proxy: {
            type: 'ajax',
            //idParam: 'sameid', // Thought idParam is not 'id' there can't be success and added this config but didnot effect
            url: MyApp.getUrl() + '/service/list',
            reader: {
                type: 'json',
                rootProperty: 'data'
            }
        },
        autoLoad: true,
        //autoSync: true,
        //remoteFilter: true
    },
    queryMode: 'remote',
    queryParam: 'description',
    autoLoad:true,
    bind: '{currRec.sameid}'
});

and here is sample JSON;

{
  "code": "XSAMPLE",
  "samid": 105899092,
  "description": "Sample Item",
},

Solution

  • And the issue is which totally all about my own enviroment setup has been solved.

    Till now I thought that issue raises through Frontend request for filtering. Just couple hours ago has examine Backend if response for request as expected and has been figure out issue's reason was not Frontend!

    The solution has solved through Backend with preparing required web service for query. For this case Backend web service was not able to query with description field on URL and they've added this service, problem solved...

    FYI to all..