Custom message in GridPanel when Store is empty

  1. #1

    Custom message in GridPanel when Store is empty

    Hi again :)

    is it possible to set and display custom message on PanelGrid if Store of this PanelGrid is empty ?


    rgds
    roszman
  2. #2

    RE: Custom message in GridPanel when Store is empty

    EmptyText property on the gridview:

    http://www.extjs.com/deploy/dev/docs....grid.GridView




    emptyText : String<div class="mdesc" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: rgb(68, 68, 68); "><div class="long" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; display: block; line-height: 18px; ">Default text (html tags are accepted) to display in the grid body when no rows are available (defaults to ''). This value will be used to update the <tt>mainBody</tt>:


  3. #3

    RE: Custom message in GridPanel when Store is empty

    thx for help, but i am not sure how should i set this propoerty in coolite GridPanel.
  4. #4

    RE: Custom message in GridPanel when Store is empty

    you set it on the view in the gridpanel
  5. #5

    RE: Custom message in GridPanel when Store is empty



    So should i do something like this?


    GridPanel grid = new GridPanel();
    grid.StoreID = myStore.ID;
    grid.title = "title";
    Column col = new Column();
    col.Header = "header";
    col.DataIndex = "Name";
    
    grid.View.View.EmptyText = "something";

    i did something like that but it is not displaying "something" message in case of empty store


    ..i know, i am noob...


    edit: i dont know why code tags are not wraping my code properly :/
  6. #6

    RE: Custom message in GridPanel when Store is empty

    If you are loading the store's data on initial page load (without doing another request using a proxy), you also need to set DeferEmptyText = False on the GridPanel's view.
  7. #7

    RE: Custom message in GridPanel when Store is empty

    Thx mate :) it is working

Similar Threads

  1. Custom cancel message
    By andrefreitasjr in forum 1.x Help
    Replies: 2
    Last Post: Mar 04, 2012, 11:16 PM
  2. Replies: 1
    Last Post: Dec 12, 2011, 5:14 PM
  3. Replies: 6
    Last Post: Nov 15, 2011, 2:02 AM
  4. Custom Error Message
    By n_s_adhikari@rediffmail.com in forum 1.x Help
    Replies: 2
    Last Post: Aug 09, 2009, 5:36 PM
  5. Replies: 0
    Last Post: Jun 26, 2009, 11:32 AM

Posting Permissions