1. #1
    Ext GWT Premium Member
    Join Date
    Dec 2008
    Location
    Brisbane, Australia
    Posts
    69
    Vote Rating
    0
    gelgey is on a distinguished road

      0  

    Default Changing empty text of a grid when store is already empty?

    Changing empty text of a grid when store is already empty?


    I have a grid that displays search results. Initially the empty text of the grid is set to "No results for search". This works fine on startup. When I do a search, I clear the store and add results: if there are no results, then the empty text shows up as expected.

    Then I tried modifying the empty text to display "Searching ..." when the search is started, and setting the empty text back to "No results for search" when the search had finished.

    When the search starts, the store is cleared and the empty text "Searching..." is displayed in the grid, as expected. But if the search returns no matches, then setting the empty text to "No results for search" has no effect.

    I assume that setting the empty text is not enough: there has to be some event (clearing the store or removing an object from the store) that will get this empty text and add it to the grid. Changing the empty text when the store is already empty (which is the case here when the search returns no results) has no effect.

    So ... if the store is already empty, how do I change the empty text of the grid so that it is visible?

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    Try calling applyEmptyText() after you set your new emptyText string.

  3. #3
    Ext GWT Premium Member
    Join Date
    Dec 2008
    Location
    Brisbane, Australia
    Posts
    69
    Vote Rating
    0
    gelgey is on a distinguished road

      0  

    Default


    Quote Originally Posted by tryanDLS View Post
    Try calling applyEmptyText() after you set your new emptyText string.
    Thanks for the info.

    The applyEmptyText() method is private in GridView but is called by GridView.refresh() so I did the following:

    Code:
    public void notifySearchStart() {
      grid.getView().setEmptyText("Searching...");
      grid.getStore().removeAll();
    }
    
    public void notifySearchFinish() {  
      grid.getView().setEmptyText("No results for search");
      // If the store is empty then refresh the grid to show the new empty text.
      if (grid.getStore().getCount() == 0) {
        grid.refresh(false);
      }
    }
    It works, but seems a bit inelegant.

  4. #4
    Ext GWT Premium Member
    Join Date
    Nov 2010
    Location
    Hyerabad
    Posts
    4
    Vote Rating
    0
    vivekmittagunta is on a distinguished road

      0  

    Default


    This fix is not working with the LiveGrid

  5. #5
    Sencha User
    Join Date
    Apr 2010
    Posts
    6
    Vote Rating
    0
    jpatel3 is on a distinguished road

      0  

    Default


    any luck with livegrid? we are also facing smae issue, its keep coming as 'Nothing Found' on bottom of the grid. is there any config we can disable in order to get rid of it?

  6. #6
    Ext JS Premium Member
    Join Date
    Aug 2010
    Posts
    52
    Vote Rating
    1
    mikih is on a distinguished road

      0  

    Default


    why are you not using a loading mask with custom text? Don't rape the ux paradigms

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."