Scrollbars in dropdownlist inside DataGrid itemEditor not working

前端 未结 2 638
遇见更好的自我
遇见更好的自我 2020-12-19 23:02

I have a DropDownList inside the itemEditor of my DataGrid. There are enough items in the DropDownList to justify scrollbars. You can see the scrollbars, and the mousewhee

相关标签:
2条回答
  • 2020-12-19 23:32

    I posted this to Adobe as a bug (SDK-27783, Flex SDK, Spark:DropDownList), which was just closed today. Alex Harui had a good workaround:

    Workaround is to change renderer as follows:

    <s:DropDownList id="ddl" 
     width="100%" 
     dataProvider="{myChoices}" open="ddl.skin['dropDown'].owner = this"/>
    

    I tested this and it solves my problem. Hopefully this will help others as well.

    0 讨论(0)
  • 2020-12-19 23:41

    I'm not sure that it's a mouseEvent that you should to trap. You can debug the framework class: DropDownController.as, put a breakpoint at the start of the systemManager_mouseDownHandler function and processFocusOut function. You can see when you clic on the dropdownlist'scrollbar that the systemManager_mouseDownHandler function doesn't call closeDropDown, closeDropDown is called by processFocusOut.

    Now add a DropDownList object at the top of your application:

    <s:DropDownList id="ddltop"
                        top="10"
                        left="10"
                        width="100%"
                        dataProvider="{dataList.getItemAt(0).choices}"
                        />
    <mx:DataGrid id="glGrid" top="50" left="10" right="10" bottom="10"
    

    ...

    and debug again with the same breakpoints. Now it's the systemManager_mouseDownHandler function that call closeDropDown.

    Perhaps the reason for the closure of the dropdownlist.

    0 讨论(0)
提交回复
热议问题