4 Replies Latest reply on Mar 9, 2007 11:49 AM by 187_2007

    Dropdown to text box?

    187_2007 Level 1
      I have a Dropdown inside my Datagrid. The requirements are for the Dropdown to have:

      1
      2
      3
      Other

      When "Other" is selected they want to be able to add text in that field... Is that possible? I'm thinking no, but thought I'd ask.
        • 1. Re: Dropdown to text box?
          ntsiii Level 3
          I am sure it is possible, but maybe not easy. I think I would build a composite component using mxml. I see a Text component, a drop-down button or image, a VBox the expands on click of the button and containing a list and and a label+TextInput in different states.

          There are a lot of design issues to be decided with such a control. If there are alwasy only three items and an other, then that is much simpler.

          Tracy
          • 2. Re: Dropdown to text box?
            babo_ya Level 3
            ntsiii!!!
            Any example or links to find out how to build a composite component using as/mxml?

            Thanks,
            • 3. Re: Dropdown to text box?
              187_2007 Level 1
              I think I have a solution... I will post my code and explanation when I have it solved... Probably done by end of week.
              • 4. Re: Dropdown to text box?
                187_2007 Level 1
                IN the DG make sure you have itemEditEnd="processData(event);

                Then in the Function do this:

                if(event.dataField == "ADSIZE"){
                var mySize:String = views.ComboBoxes.cb_AdSize(DataGrid(event.target).itemEditorInstance).combo_AdSize.text;
                var return_Adsize:Boolean = validate_size.validateAdsize(mySize);
                if (return_Adsize){
                dgExpand.editedItemRenderer.data.ADSIZE = mySize;
                dgExpand.destroyItemEditor();
                dgExpand.dataProvider.itemUpdated(event.itemRenderer.data);
                }else{
                dgExpand.destroyItemEditor();
                Alert.show("Adsize is incorrect");
                }
                }

                Message me if you need any help here. It's a bit intuitive. But I can step ya through it.