1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    3
    Vote Rating
    0
    eskimo87 is on a distinguished road

      0  

    Question dynamically setting emptyText

    dynamically setting emptyText


    How to dynamically set/change the emptyText to a textfield/textarea..?
    I didn't find any method similar to setEmptyText(val)..or so.
    Please help..

    Thanks

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      1  

    Default


    Use:
    Code:
    field.emptyText = 'New text';
    field.applyEmptyText();

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    Bangalore
    Posts
    66
    Vote Rating
    0
    Sabareesh is on a distinguished road

      0  

    Default Empty text for grid

    Empty text for grid


    How to set emptyText dynamically for the grid.
    Initially i have configured
    emptyText : "Some data "

    on some condition i want to change this empty text . How would i do that



    Thanks .

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Location
    Bangalore,IN
    Posts
    114
    Vote Rating
    0
    gameboy87 is on a distinguished road

      0  

    Default


    How Can I improve the same code for ExtJS 4.0.7 ? Thanks.

    Quote Originally Posted by Condor View Post
    Use:
    Code:
    field.emptyText = 'New text';
    field.applyEmptyText();

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Location
    Bangalore,IN
    Posts
    114
    Vote Rating
    0
    gameboy87 is on a distinguished road

      0  

    Default


    That is How to clear the emptyText value if set dynamically? I tried with setValue(""),emptyText=''. It doesn't work. Please help.

  6. #6
    Sencha User
    Join Date
    Apr 2012
    Location
    Deerfield, IL 60015
    Posts
    4
    Vote Rating
    0
    ayanatsume is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    Use:
    Code:
    field.emptyText = 'New text';
    field.applyEmptyText();
    Ohh thanks for reminding,

    I'm using [CODE]field.emptyText = [New text]; instead of ' '.
    Anyone who doesn't appreciate poetry doesn't understand that it's all about seduction.

  7. #7
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    23
    Vote Rating
    1
    byu_risk3 is on a distinguished road

      1  

    Default Domo Domo

    Domo Domo


    Thanks ayanatsume, works like a charm!

    Just in case anyone else was confused with this fix in Ext Js 4, to set textField.emptyText correctly on the fly, you need to encase the string value in brackets or else it causes head-scratching side effects.

    Example:
    Code:
     myFormPanel.getForm().findField( 'id' ).emptyText = [ '' ];
    or
    Code:
     myFormPanel.getForm().findField( 'id' ).emptyText = [ 'ID is required' ];
    ...as opposed to this
    Code:
     /* Bad Example*/
    myFormPanel.getForm().findField( 'id' ).emptyText = 'ID is required';

    Although, the fact that it needs to be encased in brackets like this is head scratching in itself...

  8. #8
    Sencha User
    Join Date
    Nov 2014
    Posts
    1
    Vote Rating
    0
    ManjuRaman is on a distinguished road

      0  

    Default Empty Text for List Config

    Empty Text for List Config


    Please any one suggest how to dynamically set emptyText property in combo Box listConfig ..