Results 1 to 4 of 4

Thread: Combo : how to manually display loadingText in LOCAL mode ?

  1. #1
    Sencha Premium User
    Join Date
    Jun 2007
    Location
    France
    Posts
    56

    Default Combo : how to manually display loadingText in LOCAL mode ?

    Hello,

    I've a combo in local mode (mode: 'local') that i load with a Ext.Ajax.request and a combo.getStore().loadData() of the result.

    I want to display the loadingText before my call of Ext.Ajax.request (to have a "mode: remote" effect).
    How i can do this ?

    Best regards.
    pbaccari.

  2. #2
    Ext User zhegwood's Avatar
    Join Date
    Dec 2007
    Location
    Boulder, CO Suburbia (Lafayette)
    Posts
    388

    Default

    Why not use mode: "remote"? This is exactly for what it's intended.

  3. #3
    Sencha Premium User
    Join Date
    Jun 2007
    Location
    France
    Posts
    56

    Default

    I don't use "remote" because I use check results with errors management, and I've make functions which work with all objets (combo, tree, grid ...).

    In case I load data on select of other combo, I would like to show that my combo is under loading ...

    But, why ?

  4. #4
    Sencha Premium User
    Join Date
    Jun 2007
    Location
    France
    Posts
    56

    Default [CLOSED] : Combo : how to manually display loadingText in LOCAL mode ?

    Hello,

    I've found a soluce :

    1)
    I override Ext.form.ComboBox with code found in "onBeforeLoad" :
    Code:
    Ext.override(Ext.form.ComboBox, {
        showLoadingText: function () {
            if (this.rendered && this.innerList != null) {
                this.innerList.update(this.loadingText ? '<div class="loading-indicator">' + this.loadingText + '</div>' : '');
                this.restrictHeight();
                this.selectedIndex = -1;
            }
        }
    });
    So i could call my "showLoadingText" when i want.

    2)
    There's a problem whem the combo is empty, this.innerList return an error.
    So, i add in the if condition of my function the second parts "&& this.innerList != null"

    And, before calling "showLoadingText", I put in the combo a value like :
    Code:
    combo.getStore().loadData({
        "data": [{
            "id": "",
            "libelle": "En cours de chargement ..."
        }]
    },
    false);
    combo.showLoadingText();

    Please let me make comments for improvements or most appropriate method.

    Best regards.
    pbaccari

Posting Permissions

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