flex中list添加信息怎么弄
我要把combobox里边的一条信息单击一个按钮石头显示在list里面,就是那个网上有的http://www.blueidea.com/tech/multimedia/2...
我要把combobox 里边的一条信息 单击一个按钮石头 显示在list里面,就是 那个网上有的 http://www.blueidea.com/tech/multimedia/2004/2130_3.asp
列子 可是代码不全 可以详细说明么
简单的购物车中,我们显示一个咖啡品牌的列表(类似于HTML的select)。使用数据绑定功能在下面显示当前选择的品牌的说明,还有一个添加到购物车的按钮,当按钮被按下后,该品牌的咖啡便会被添加到购物列表中。 展开
列子 可是代码不全 可以详细说明么
简单的购物车中,我们显示一个咖啡品牌的列表(类似于HTML的select)。使用数据绑定功能在下面显示当前选择的品牌的说明,还有一个添加到购物车的按钮,当按钮被按下后,该品牌的咖啡便会被添加到购物列表中。 展开
展开全部
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<!-- data model -->
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var coffeeArray:ArrayCollection = new ArrayCollection(
[{label:"Red Sea",data:"Smooth and fragrant"},
{label:"Andes",data:"Rich and pungent"},
{label:"Blue Mountain",data:"Delicate and refined"}
])
private var cartArray:ArrayCollection = new ArrayCollection();
public function addToCart():void
{
cartArray.addItem(coffeeCombo.selectedItem.label);
}
]]>
</mx:Script>
<!-- view -->
<mx:Panel title="My First Flex App">
<mx:Label text="Coffee Blends"/>
<mx:ComboBox id="coffeeCombo" dataProvider="{coffeeArray}"/>
<mx:Text text="Description: {coffeeCombo.selectedItem.data}"/>
<mx:Button label="Add to Cart" click="addToCart()"/>
<mx:List dataProvider="{cartArray}" />
</mx:Panel>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<!-- data model -->
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var coffeeArray:ArrayCollection = new ArrayCollection(
[{label:"Red Sea",data:"Smooth and fragrant"},
{label:"Andes",data:"Rich and pungent"},
{label:"Blue Mountain",data:"Delicate and refined"}
])
private var cartArray:ArrayCollection = new ArrayCollection();
public function addToCart():void
{
cartArray.addItem(coffeeCombo.selectedItem.label);
}
]]>
</mx:Script>
<!-- view -->
<mx:Panel title="My First Flex App">
<mx:Label text="Coffee Blends"/>
<mx:ComboBox id="coffeeCombo" dataProvider="{coffeeArray}"/>
<mx:Text text="Description: {coffeeCombo.selectedItem.data}"/>
<mx:Button label="Add to Cart" click="addToCart()"/>
<mx:List dataProvider="{cartArray}" />
</mx:Panel>
</mx:Application>
展开全部
<?xml
version="1.0"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
>
<!--
data
model
-->
<mx:Script>
<![CDATA[
import
mx.collections.ArrayCollection;
[Bindable]
private
var
coffeeArray:ArrayCollection
=
new
ArrayCollection(
[{label:"Red
Sea",data:"Smooth
and
fragrant"},
{label:"Andes",data:"Rich
and
pungent"},
{label:"Blue
Mountain",data:"Delicate
and
refined"}
])
private
var
cartArray:ArrayCollection
=
new
ArrayCollection();
public
function
addToCart():void
{
cartArray.addItem(coffeeCombo.selectedItem.label);
}
]]>
</mx:Script>
<!--
view
-->
<mx:Panel
title="My
First
Flex
App">
<mx:Label
text="Coffee
Blends"/>
<mx:ComboBox
id="coffeeCombo"
dataProvider="{coffeeArray}"/>
<mx:Text
text="Description:
{coffeeCombo.selectedItem.data}"/>
<mx:Button
label="Add
to
Cart"
click="addToCart()"/>
<mx:List
dataProvider="{cartArray}"
/>
</mx:Panel>
</mx:Application>
version="1.0"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
>
<!--
data
model
-->
<mx:Script>
<![CDATA[
import
mx.collections.ArrayCollection;
[Bindable]
private
var
coffeeArray:ArrayCollection
=
new
ArrayCollection(
[{label:"Red
Sea",data:"Smooth
and
fragrant"},
{label:"Andes",data:"Rich
and
pungent"},
{label:"Blue
Mountain",data:"Delicate
and
refined"}
])
private
var
cartArray:ArrayCollection
=
new
ArrayCollection();
public
function
addToCart():void
{
cartArray.addItem(coffeeCombo.selectedItem.label);
}
]]>
</mx:Script>
<!--
view
-->
<mx:Panel
title="My
First
Flex
App">
<mx:Label
text="Coffee
Blends"/>
<mx:ComboBox
id="coffeeCombo"
dataProvider="{coffeeArray}"/>
<mx:Text
text="Description:
{coffeeCombo.selectedItem.data}"/>
<mx:Button
label="Add
to
Cart"
click="addToCart()"/>
<mx:List
dataProvider="{cartArray}"
/>
</mx:Panel>
</mx:Application>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询