1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    5
    Vote Rating
    0
    cellarosi is on a distinguished road

      0  

    Default Unanswered: Problem between combobox and store

    Unanswered: Problem between combobox and store


    Hi,
    sorry if I'm not on right section and for the english..

    I have a problem with store and dynamic combobox.
    My situation is particular so I'll try to explane only one simple example that should reproduce the problem...

    I have a combobox with store linked to it. Near that I build a button needed to reload
    a store with random different data . All these component are created together at the start of the page.
    So you have a select box and the button reload a store that need to populate that combo.

    At the first time I click a button, the store is loaded without any problems and the combo is
    populated. But if i close the combo and I click again on the button, when I try to reopen the combo,
    the "Login.." appear and nothing change..
    It doesn't try to make any call (i checked with firebug).
    It' only put the wait message. In this situation (mean with open combo), if i try to realod the data, all will be right.

    The data have been loaded correctly because i see them, but the loading messages avoid me to click them.
    It seems that the combo doesn't know that it has only to display the message without search anything..

    Any ideas?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,083
    Answers
    675
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    If you close the combo and update the store, the combo has no knowledge of the change.
    You will need to tell the combo to load the store again.

    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    5
    Vote Rating
    0
    cellarosi is on a distinguished road

      0  

    Default


    Yes, exactly, but i don't know how do it...
    Have you an idea???

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,083
    Answers
    675
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Have a look at combo.lastQuery

    Scott.

  5. #5
    Sencha User
    Join Date
    Mar 2011
    Posts
    5
    Vote Rating
    0
    cellarosi is on a distinguished road

      0  

    Default


    I read docs about that and I found the best way to do it should be declaring a beforequery listeners with
    delete queryEvent.combo.lastQuery inside it.

    I have tried with queryEvent.combo.lastQuery = null; and with delete queryEvent.combo.lastQuery;

    But both doesn't work.

    The loading still there

  6. #6
    Sencha User
    Join Date
    Mar 2011
    Posts
    5
    Vote Rating
    0
    cellarosi is on a distinguished road

      0  

    Default Loading gif

    Loading gif


    No idea about that???

  7. #7
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,083
    Answers
    675
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Please provide some code... that should reset query.

    Scott.

  8. #8
    Sencha User
    Join Date
    Mar 2011
    Posts
    5
    Vote Rating
    0
    cellarosi is on a distinguished road

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    Please provide some code... that should reset query.

    Scott.
    I did it from designer.. This is the column
    Code:
    xtype: 'gridcolumn',
    renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
        store = Ext.getStore('HourTypes');
        index = store.findExact('id',value); 
        if (index != -1){
            rs = store.getAt(index).data; 
            return rs.text; 
        }
        return '';
    },
    id: 'HoursType',
    dataIndex: 'hour_type_edit_id',
    flex: 1,
    text: 'Tipo di ora',
    field: {
        xtype: 'combobox',
        id: 'hour_type',
        fieldLabel: 'Label',
        hideLabel: true,
        forceSelection: true,
        queryMode: 'local',
        store: 'HourTypes',
        valueField: 'id',
        listeners: {
            beforequery: {
                fn: me.onHour_typeBeforeQuery,
                scope: me
            },
            show: {
                fn: me.onHour_typeShow,
                scope: me
            }
        }
    }
    where onHour_typeBeforeQuery ‚Äčis:

    Code:
    onHour_typeBeforeQuery: function(queryEvent, options) {
            queryEvent.combo.lastQuery = null;
        }

Thread Participants: 1

Tags for this Thread