Results 1 to 4 of 4

Thread: Ext.view.View emptyText style

  1. #1
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    260
    Answers
    6

    Default Ext.view.View emptyText style

    Hi, I'm trying to build simple dashboard using ExecutiveDashboard example that comes with Ext 5.1.0.
    My question is how can I style emptyText?

    I specified emptyText property inside my view, but Ext.view.View don't have emptyCls.
    For now I'm using this:

    PHP Code:
    emptyText'<div class="empty">No data!</div>'
    Can I use tpl for it?
    Right now I have tpl defined as so:
    PHP Code:
        tpl: [
            
    '<tpl for=".">',
                
    '<div class="thumb-wrap">',
                    
    '<a class="thumb" href="{Url}" target="_blank">',
                        
    '<div class="thumb-icon icon-{Type}"></div>',
                        
    '<div class="thumb-title-container">',
                            
    '<div class="thumb-title">{Name}</div>',
                            
    '<div class="thumb-title-small">Data aktualizacji: {EditDate}</div>',
                         
    '</div>',
                        
    '<div class="thumb-download"></div>',
                    
    '</a>',
                
    '</div>',
            
    '</tpl>'
        
    ], 
    Can I check inside tpl if there is data inside store?

  2. #2
    Sencha Premium User lumberjack's Avatar
    Join Date
    Nov 2014
    Location
    Kansas
    Posts
    781
    Answers
    102

    Default

    The emptyText value is rendered to a div which has the class "x-grid-empty" applied to it. Overriding the styling of that class could do the trick.

    Regards,
    Brian

    https://fiddle.sencha.com/#fiddle/fa8

  3. #3
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    260
    Answers
    6

    Default

    @lumberjack thanks for demo, but my question was about Ext.view.View.
    It has no empty class.

    Could You please update Your answer?

  4. #4
    Sencha Premium User lumberjack's Avatar
    Join Date
    Nov 2014
    Location
    Kansas
    Posts
    781
    Answers
    102

    Default

    An emptyCls config does not exist on the grid nor the dataview. When using a dataview you could do as you've demonstrated, wrapping the empty text message in a div. You could go so far as to apply the grid's emptyText class to your div as well.

    Regards,
    Brian

    https://fiddle.sencha.com/#fiddle/fcl

Posting Permissions

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