Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jul 2012
    Location
    Italy
    Posts
    84
    Vote Rating
    4
    Tegola is on a distinguished road

      0  

    Default Empty dataview styling

    Empty dataview styling


    Hello,
    I wanted to know when a dataview or list is empty, and style it accordingly.

    I could style the emptyText element to fill the entire list space, but changing that element's background color would cover the list's scrolldocked items.

    Here's a quick fix I used in my two subclasses (dataview and list). I'd like to know if there's a way to override just the dataview class, though:
    Code:
    Ext.define('MyDataView', {
        extend: 'Ext.DataView',
        
        getEmptyCls: function(){
            return this.getBaseCls() + '-empty';
        },
        
        showEmptyText: function(){
            this.callParent();
            this.addCls(this.getEmptyCls());
        },
        
        hideEmptyText: function(){
            this.callParent();
            this.removeCls(this.getEmptyCls());
        }
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,795
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by Tegola View Post
    I'd like to know if there's a way to override just the dataview class
    Meaning that you want it only to affect the dataview and not the list?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Location
    Italy
    Posts
    84
    Vote Rating
    4
    Tegola is on a distinguished road

      0  

    Default


    No, I mean I'd like to directly override the Dataview class and have it propagated to the List class.
    In my quick fix I just subclassed the dataview and the list, and I use those two subclasses whenever I need a dataview or a list.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,795
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You can create an override:

    Code:
    Ext.define('Override.dataview.DataView', {
        override: 'Ext.dataview.DataView',
        
        getEmptyCls: function(){
            return this.getBaseCls() + '-empty';
        },
        
        showEmptyText: function(){
            this.callParent();
            this.addCls(this.getEmptyCls());
        },
        
        hideEmptyText: function(){
            this.callParent();
            this.removeCls(this.getEmptyCls());
        }
    });
    All you have to do is require this in app.js and it will affect all dataviews
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Jul 2012
    Location
    Italy
    Posts
    84
    Vote Rating
    4
    Tegola is on a distinguished road

      0  

    Default


    Oh cool, I thought overriding a class method would replace that method entirely!

    Anyway, I did start this thread as a feature request to have an additional "empty" class. Even if I have the override, that class would be useful for everyone else, so the request is still valid

    Thanks

Thread Participants: 1

Tags for this Thread

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..." hd porno faketaxi