1. #1
    Ext User
    Join Date
    Nov 2007
    Posts
    9
    Vote Rating
    0
    kmoncada is on a distinguished road

      0  

    Thumbs up Updating a gridview's emptyText?

    Updating a gridview's emptyText?


    Hi all,

    I am building a search application with a gridpanel that searches through all "shared" documents. At the moment, since there are no shared documents, I decided to set the emptyText message to 'No documents have been shared at this time."

    (GridPanel's ViewConfig)
    PHP Code:
    viewConfig: {
         ...
         
    emptyText'No documents have been shared at this time. ',
         
    deferEmptyTextfalse,
         ...

    This works great.

    I have since inserted many dummy shared documents to test the search feature and all is working well.

    But when I search for something like ""oiuoifuoifjlkasjdlkajsd" which cannot be found in any of the shared documents, it defaults to the emptyText msg (and rightfully so) of "No documents have been shared at this time." ... which is not correct. Meaning there are shared documents, but none that match the search query.

    How do I go about updating this emptyText msg to 'No results found for "oiuoifuoifjlkasjdlkajsd".' when the datastore returns 0 results?

    I've tried within my datastore:

    PHP Code:
    listeners: {
         
    'beforeload': function() {
              
    this.baseParams.type mySearchType.getValue();
         },
         
    'load': function(srecordsoptions){
              var 
    resultsCount dsLoepSearch.data.getCount();
              if(
    resultsCount == 0){
                   
    searchgrid.viewConfig.emptyText 'Hello world.'// This does not work.
              
    }
         }





    }

  2. #2
    Sencha User
    Join Date
    Jan 2008
    Location
    CA
    Posts
    47
    Vote Rating
    0
    Ant1105 is on a distinguished road

      0  

    Default


    Did you try calling refresh() on the gridview? You could also try this:

    PHP Code:
    if (resultsCount == 0) {
        
    searchgrid.getView().mainBody.update('<div class="x-grid-empty">' yourMessage '</div>');


  3. #3
    Ext User
    Join Date
    Nov 2007
    Posts
    9
    Vote Rating
    0
    kmoncada is on a distinguished road

      0  

    Default


    Awesome! Both of these ideas worked.
    PHP Code:
    if (resultsCount == 0) {    
         
    searchgrid.getView().mainBody.update('<div class="x-grid-empty">' yourMessage '</div>');



    PHP Code:
    if (resultsCount == 0) {    
         
    searchgrid.view.emptyText 'No results found for "akjhdkjdhkdjhkdjfhs".';
         
    searchgrid.view.refresh();


  4. #4
    Sencha User
    Join Date
    Jan 2008
    Location
    CA
    Posts
    47
    Vote Rating
    0
    Ant1105 is on a distinguished road

      0  

    Thumbs up


    Cool!

Thread Participants: 1

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..."