Flex 4 Drop Down List - bound with data service, how to always keep prompt or add item at index -1 programmatically

送分小仙女□ 提交于 2019-12-10 11:43:54

问题


I have a drop down list that is bound using an HTTP data service from a database (set up through the wizard, not as a declaration). My drop down list changes the values in my datagrid and I need that "Select One" null value so that users can select everything. Here is my drop down list:

<s:DropDownList id="ddlProducts" width="400" prompt="Select a Product" close="dataGridContentChanging()" creationComplete="ddlProducts_creationCompleteHandler(event)" labelField="Title">  
    <s:dataProvider>  
        <s:AsyncListView list="{GetProductsResult.lastResult}"/>  
   </s:dataProvider>  
</s:DropDownList>

Is there a way to always keep the prompt or to programmatically add a "Select One" to the -1 index of the drop down list?

Any help is apprecitated. Thanks!


回答1:


setup an all value in ur Database
(any number of ways to do: this if you are using a look up table just add it to the table, if you are pulling from your data table put in a union statement)

then handle the the 'All' value (on click) to put in '%' as ur variable in dataprovider



来源:https://stackoverflow.com/questions/4341364/flex-4-drop-down-list-bound-with-data-service-how-to-always-keep-prompt-or-ad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!