Flex Gumbo中如何通过includeIn和excludeFrom给应用固定特定字符串的例子
By Minidxer | July 15, 2009
接下来的例子演示了Flex Gumbo中如何通过includeIn和excludeFrom给应用固定特定字符串。
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <!-- http://blog.flexexamples.com/2009/02/24/hiding-specific-items-in-a-data-provider-based-on-the-current-application-state-in-flex-gumbo/ -->
- <FxApplication name="String_includeIn_test"
- xmlns="http://ns.adobe.com/mxml/2009"
- backgroundColor="white">
- <states>
- <State name="one" />
- <State name="two" />
- <State name="three" />
- </states>
- <ApplicationControlBar>
- <Form styleName="plain">
- <FormItem label="currentState:">
- <Label text="{currentState}" />
- </FormItem>
- <FormItem direction="horizontal">
- <FxButton label="State one"
- click="currentState='one';" />
- <FxButton label="State two"
- click="currentState='two';" />
- <FxButton label="State three"
- click="currentState='three';" />
- </FormItem>
- </Form>
- </ApplicationControlBar>
- <FxList id="list"
- horizontalCenter="0"
- bottom="40">
- <dataProvider>
- <ArrayCollection>
- <String>1. The</String>
- <String>2. Quick</String>
- <String>3. Brown</String>
- <String includeIn="one">4. Fox</String>
- <String includeIn="two">5. Jumps</String>
- <String includeIn="one,two">6. Over</String>
- <String excludeFrom="one">7. The</String>
- <String excludeFrom="two">8. Lazy</String>
- <String excludeFrom="one,two">9. Dog</String>
- </ArrayCollection>
- </dataProvider>
- </FxList>
- </FxApplication>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Gumbo, Other |
No Comments » |
Tags: currentState, excludeFrom, Gumbo, includeIn, state