5 Replies Latest reply on Aug 15, 2013 8:00 PM by Flexicious

    ComboBox rowCount and dropDownWidth

    toft Level 1

      Where have they gone ? I dont see them in spark combobox. Do I have to fiddle with skins to get to these properties ??

        • 1. Re: ComboBox rowCount and dropDownWidth
          David_F57 Level 5

          hi,

           

          you can get the width and height from

           

            myCombo.dropDown.width;

            myCombo.dropDown.height;

           

          not sure about the rowcount, maybe from the layout of the dropdown you can get rowheight and use that. I'll have a look and see what the go is.

           

          David.

          • 2. Re: ComboBox rowCount and dropDownWidth
            toft Level 1

            trace(myCombobox.dropDown); // return null

             

            I get a 'null object reference' when trying myCombobox.dropDown.width;

             

            Are there other ways to access dropDown ?

            • 3. Re: ComboBox rowCount and dropDownWidth
              Abishek-Developer

              myCombo.dropDown is null always.. pls guide me..

              • 4. Re: ComboBox rowCount and dropDownWidth
                eprevot123 Level 2

                I think the dropDown is null when the ComboBox is closed, because then there is no dropDown list.

                So you may be able listen the "open" event and set the dropDown dimensions ?

                • 5. Re: ComboBox rowCount and dropDownWidth
                  Flexicious Level 1

                  Love it or hate it, Spark has its quirks.

                   

                  public function DropDownList()

                                      {

                                                super();

                                    addEventListener(DropDownEvent.OPEN,onOpen);

                   

                   

                                      }

                   

                                      protected function onOpen(event:DropDownEvent):void

                                      {

                                                if(this.dropdownWidth)

                                                {

                                                          this.dropDown.width= this.dropdownWidth;

                                                }

                                      }

                   

                    public var dropdownWidth:int;