Flex Gumbo中如何通过includeIn和excludeFrom给应用固定特定字符串的例子

By Minidxer | July 15, 2009

接下来的例子演示了Flex Gumbo中如何通过includeIn和excludeFrom给应用固定特定字符串。

让我们先来看一下Demo可以点击这里察看源代码):


下面是完整代码(或点击这里察看):

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- http://blog.flexexamples.com/2009/02/24/hiding-specific-items-in-a-data-provider-based-on-the-current-application-state-in-flex-gumbo/ -->
  3. <FxApplication name="String_includeIn_test"
  4.         xmlns="http://ns.adobe.com/mxml/2009"
  5.         backgroundColor="white">
  6.  
  7.     <states>
  8.         <State name="one" />
  9.         <State name="two" />
  10.         <State name="three" />
  11.     </states>
  12.  
  13.     <ApplicationControlBar>
  14.         <Form styleName="plain">
  15.             <FormItem label="currentState:">
  16.                 <Label text="{currentState}" />
  17.             </FormItem>
  18.             <FormItem direction="horizontal">
  19.                 <FxButton label="State one"
  20.                         click="currentState='one';" />
  21.                 <FxButton label="State two"
  22.                         click="currentState='two';" />
  23.                 <FxButton label="State three"
  24.                         click="currentState='three';" />
  25.             </FormItem>
  26.         </Form>
  27.     </ApplicationControlBar>
  28.  
  29.     <FxList id="list"
  30.             horizontalCenter="0"
  31.             bottom="40">
  32.         <dataProvider>
  33.             <ArrayCollection>
  34.                 <String>1. The</String>
  35.                 <String>2. Quick</String>
  36.                 <String>3. Brown</String>
  37.                 <String includeIn="one">4. Fox</String>
  38.                 <String includeIn="two">5. Jumps</String>
  39.                 <String includeIn="one,two">6. Over</String>
  40.                 <String excludeFrom="one">7. The</String>
  41.                 <String excludeFrom="two">8. Lazy</String>
  42.                 <String excludeFrom="one,two">9. Dog</String>
  43.             </ArrayCollection>
  44.         </dataProvider>
  45.     </FxList>
  46.  
  47. </FxApplication>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: Gumbo, Other | No Comments » | Tags: , , , ,

Search Posts