我正在努力找出在Flex(3.4)DataGrid中嵌入ComboBox的"正确"方法.通过权利(例如根据这个页面http://blog.flexmonkeypatches.com/2008/02/18/simple-datagrid-combobox-as-item-editor-example/)它应该很容易,但我不能为我的生活使这项工作.
我对上面链接的示例的不同之处在于,我的显示值(用户看到的内容)与我想在我的数据提供程序中选择并存储的id值不同.
所以我拥有的是:
<mx:DataGridColumn headerText="Type" width="200" dataField="TransactionTypeID" editorDataField="value" textAlign="center" editable="true" rendererIsEditor="true">
<mx:itemRenderer>
<mx:Component>
<mx:ComboBox dataProvider="{parentDocument.transactionTypesData}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
Run Code Online (Sandbox Code Playgroud)
transactionTypesData"数据"和"标签"字段在哪里(根据什么ComboBox- 为什么它不提供labelField和idField,我永远不会知道).
无论如何,上面的MXML代码不能以两种方式工作:
那么,有没有人有类似的情况工作?
我正在使用ScanHardware功能来获取更新的相机列表.如果将相机插入我的Mac mini,则会更新相机长度.如果我插入相机我的应用程序突然关闭.
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
height="280"
width="280"
creationComplete="test1()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.controls.Alert;
public var hardwareTimer:Timer;
public function test1():void{
hardwareTimer = new Timer(5000);
hardwareTimer.addEventListener(TimerEvent.TIMER,refreshHardware);
hardwareTimer.start();
}
public function refreshHardware(ev:TimerEvent):void{
flash.media.scanHardware();
Alert.show(Camera.names.length.toString());
}
]]>
</fx:Script>
</s:WindowedApplication>
Run Code Online (Sandbox Code Playgroud)
如果我
Camera.names在拔掉任何电源后使用Camera,我的应用程序就会崩溃.
如何解决这个问题?
如何设置插入位置,只有
this.caretIndex(READ)
我想自动构建一个flex库项目而不是当前进程,这涉及我们的一个开发人员在他的机器上编译它然后我们检查生成的.swc文件.这很糟糕.
我是从Java开发人员的角度来看这个,所以我很难掌握Flex Builder 3应用程序中提供的编译工具,但这就是我已经拥有的:
<mxmlc/>和执行<compc/>任务.我想要的是一个ant脚本,它将完成以下步骤:
到目前为止我有这个:
<target name="compile-component" depends="init">
<compc output="${DEPLOY_DIR}/${SWC_NAME}.swc">
<source-path path-element="${FLEX_HOME}/frameworks"/>
<source-path path-element="${SRC_DIR}"/>
</compc>
</target>
Run Code Online (Sandbox Code Playgroud)
但是,它不包括任何内容:
[compc] Loading configuration file /Applications/Adobe Flex Builder 3/sdks/3.2.0/frameworks/flex-config.xml
[compc] Adobe Compc (Flex Component Compiler)
[compc] Version 3.2.0 build 3958
[compc] Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
[compc]
[compc] Error: nothing was specified to be included in the library
[compc]
[compc] Use 'compc -help' for information about using the command line.
Run Code Online (Sandbox Code Playgroud)
看起来我需要枚举我想要包含在库中的每个类,这是......荒谬的.肯定有更好的办法.我该怎么做呢?
任何人都可以提供一些例子吗?我正在浏览,但无法找到这种类型的一个例子.
编辑
浏览了很多,并找到了如何将datagrid数据转换为csv格式.现在如何将其转换为excel?有没有办法在不使用任何服务器脚本的情况下执行此操作?难道不能单独在Flex中完成吗?
我的问题:我有一个标签导航器,每个标签中都有许多表格.但我有一个全局保存按钮.问题是,如果我不打开Tab,它就不会被初始化,因此它包含的表单不存在..
如何让用户点击每个标签?
在Flex中计算Dictionary对象长度的最佳方法是什么?
var d:Dictionary = new Dictionary();
d["a"] = "alpha";
d["b"] = "beta";
Run Code Online (Sandbox Code Playgroud)
我想检查这个词典应该是2的长度.除了循环遍历对象之外,还有什么方法可以做到吗?
我有一个自定义ItemRenderer,它在3个面板中显示5个文本输入:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox
xmlns:mx="http://www.adobe.com/2006/mxml"
height="300"
width="800"
creationComplete="onCreationComplete()"
>
<!-- code-behind -->
<mx:Script source="ChainListRenderer.mxml.as" />
<mx:Label text="{data.title}" fontSize="25" fontWeight="bold" width="100%" textAlign="center" />
<mx:HBox>
<mx:Panel id="triggerPanel" title="Trigger" width="260">
<mx:VBox id="tpBoxes" width="100%" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5">
<mx:TextInput id="trigger1" width="100%" textAlign="left" tabIndex="0" tabEnabled="true" />
<mx:TextInput id="trigger2" width="100%" textAlign="left" tabIndex="1" tabEnabled="true" />
<mx:TextInput id="trigger3" width="100%" textAlign="left" tabIndex="2" tabEnabled="true" />
<mx:TextInput id="trigger4" width="100%" textAlign="left" tabIndex="3" tabEnabled="true" />
<mx:TextInput id="trigger5" width="100%" textAlign="left" tabIndex="4" tabEnabled="true" />
</mx:VBox>
</mx:Panel>
<mx:Panel id="linkPanel" title="Link" width="260">
<mx:VBox id="lpBoxes" …Run Code Online (Sandbox Code Playgroud) 我在interweb周围进行了很好的翻找,似乎无法找到任何三态复选框的例子.它看起来不受SDK支持,我在网上找不到任何示例.
我想这是一个常见的问题,在我开始自己编写之前,有没有人知道我可以使用的一个好的flex三态复选框组件:)
干杯,
Jawache.
我想知道如何在Flex的高级网格中创建"叠加层"?请在此处查看示例
flex3 ×10
apache-flex ×8
itemrenderer ×2
actionscript ×1
adobe ×1
ant ×1
camera ×1
datagrid ×1
flexbuilder ×1
macos ×1
tabs ×1
usability ×1