1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Toulouse
    Posts
    60
    Vote Rating
    0
    Answers
    7
    novadys-sbu is on a distinguished road

      0  

    Default Unanswered: Odd placeholder behaviour

    Unanswered: Odd placeholder behaviour


    Hey guys,

    I'm trying to dev an sencha app and have come across a problem which I can't seem to get around.

    I have two selectfields (dropdown menus). The second one is dependant on the first. What I want to do is : have a placeholder if there are several items in the store and have no placeholder (or placeholder = null) if the store only contains one item.

    Here is my listener :

    Code:
    listeners:{
                load : function(myStore){
                   var count = myStore.getCount();
                   if(count != 1){
                       Ext.getCmp('strClassReference')._placeHolder = rcChooseDocType;;
                   }else{
                       Ext.getCmp('strClassReference')._placeHolder = null;
                   }
                }
              }
    My problem is that the rendering doesn't seem to function properly. I always have the placeholder of the previous choice even though the value of the placeholder is correct (checked with a console.debug)

    Does anyone have an idea how to refresh the component ? I've tried the show and hide function, but I haven't had any luck

    Thanks guys
    Sarah Burrell
    R & D Developer at Novadys International

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,053
    Vote Rating
    658
    Answers
    471
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    You can't just set the property, you need to use the method: http://docs.sencha.com/touch/2-2/#!/...setPlaceHolder
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Location
    Toulouse
    Posts
    60
    Vote Rating
    0
    Answers
    7
    novadys-sbu is on a distinguished road

      0  

    Default Thanks but...

    Thanks but...


    Thank you for answering but I have also tried with setPlaceHolder() and get the same result.

    It seem that what is rendered is the placeHolder value of the previous choice.
    Any more ideas ?
    Sarah Burrell
    R & D Developer at Novadys International

Thread Participants: 1

Tags for this Thread