- 浏览: 785649 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (360)
- Java (101)
- JPA/Hibernate (10)
- Spring (14)
- Flex/BlazeDS (37)
- Database (30)
- Lucene/Solr/Nutch (0)
- Maven/Ant (25)
- CXF/WebService (3)
- RPC/RMI/SOAP/WSDL (1)
- REST (6)
- TDD/BDD/JUnit (1)
- Servlet/JSP (2)
- AI/MachineLearning (3)
- Resource (1)
- 字符编码 (2)
- OOA/OOPS/UML (5)
- DesignPattern (8)
- 算法与数据结构 (11)
- Web&App Server (13)
- 并发&异步&无阻塞 (7)
- Entertainment (4)
- JavaScript/ExtJS (45)
- CodeStyle&Quality (1)
- svn/git/perforce (8)
- JSON (2)
- JavaScriptTesting (4)
- Others (6)
- RegularExpression (2)
- Linux/Windows (12)
- Protocal (2)
- Celebrities (1)
- Interview (1)
- 计算机语言 (1)
- English (2)
- Eclipse (5)
- TimeZone/时区 (1)
- Finance (1)
- 信息安全 (1)
- JMS/MQ (2)
- XSD/XML/DTD (3)
- Android (4)
- 投资 (3)
- Distribution (3)
- Excel (1)
最新评论
-
qdujunjie:
如果把m换成具体的数字,比如4或者5,会让读者更明白
m阶B树中“阶”的含义 -
java-admin:
不错,加油,多写点文章
关于Extjs的mixins和plugin -
xiehuaidong880827:
你好,我用sencha cmd打包完本地工程后,把app.js ...
ExtJS使用Sencha Cmd合并javascript文件为一个文件 -
KIWIFLY:
lwpan 写道inverse = "true&qu ...
Hibernate中什么时候使用inverse=true -
luedipiaofeng:
good
消除IE stop running this script弹出框
Cannot select certain rows in List component or DataGrid component
The problem is that for each item in data provider, we must get a unique ID (UID) for it, if two or more items in data provider get the same UID after call itemToUID method, then we only can select one of them and can never successful to select the rest of them. To avoid this problem, refer to the following itemToUID method to understand how Flex components generate the UID and avoid generating the same UID.
Please Note, the following method itemToUID are quoted from class ListBase of SDK source code.
We can use: copyOfOldObject= ObjectUtil.copy(oldObject) to get a new instance, then when we add the copy to the ArrayCollection which is the binding source of dataProvider, we will get different UID for each instance, then we won’t have the problem.
/**
* Determines the UID for a data provider item. All items
* in a data provider must either have a unique ID (UID)
* or one will be generated and associated with it. This
* means that you cannot have an object or scalar value
* appear twice in a data provider. For example, the following
* data provider is not supported because the value "foo"
* appears twice and the UID for a string is the string itself:
*
* <blockquote>
* <code>var sampleDP:Array = ["foo", "bar", "foo"]</code>
* </blockquote>
*
* Simple dynamic objects can appear twice if they are two
* separate instances. The following is supported because
* each of the instances will be given a different UID because
* they are different objects:
*
* <blockquote>
* <code>var sampleDP:Array = [{label: "foo"}, {label: "foo"}]</code>
* </blockquote>
*
* Note that the following is not supported because the same instance
* appears twice.
*
* <blockquote>
* <code>var foo:Object = {label: "foo"};
* sampleDP:Array = [foo, foo];</code>
* </blockquote>
*
* @param data The data provider item.
*
* @return The UID as a string.
*/
protected function itemToUID(data:Object):String
{
if (data == null)
return "null";
return UIDUtil.getUID(data);
}
The problem is that for each item in data provider, we must get a unique ID (UID) for it, if two or more items in data provider get the same UID after call itemToUID method, then we only can select one of them and can never successful to select the rest of them. To avoid this problem, refer to the following itemToUID method to understand how Flex components generate the UID and avoid generating the same UID.
Please Note, the following method itemToUID are quoted from class ListBase of SDK source code.
We can use: copyOfOldObject= ObjectUtil.copy(oldObject) to get a new instance, then when we add the copy to the ArrayCollection which is the binding source of dataProvider, we will get different UID for each instance, then we won’t have the problem.
/**
* Determines the UID for a data provider item. All items
* in a data provider must either have a unique ID (UID)
* or one will be generated and associated with it. This
* means that you cannot have an object or scalar value
* appear twice in a data provider. For example, the following
* data provider is not supported because the value "foo"
* appears twice and the UID for a string is the string itself:
*
* <blockquote>
* <code>var sampleDP:Array = ["foo", "bar", "foo"]</code>
* </blockquote>
*
* Simple dynamic objects can appear twice if they are two
* separate instances. The following is supported because
* each of the instances will be given a different UID because
* they are different objects:
*
* <blockquote>
* <code>var sampleDP:Array = [{label: "foo"}, {label: "foo"}]</code>
* </blockquote>
*
* Note that the following is not supported because the same instance
* appears twice.
*
* <blockquote>
* <code>var foo:Object = {label: "foo"};
* sampleDP:Array = [foo, foo];</code>
* </blockquote>
*
* @param data The data provider item.
*
* @return The UID as a string.
*/
protected function itemToUID(data:Object):String
{
if (data == null)
return "null";
return UIDUtil.getUID(data);
}
发表评论
-
Panel高度为0但里面的组件依旧显示
2013-04-24 14:34 1084解决办法: 把Panel中的内容组件用<s:Scroll ... -
约束布局constraint layout
2013-03-01 14:02 1791约束布局constraint layout要点: 1)只有支持 ... -
根据屏幕分辨率动态调整组件大小
2013-02-22 17:34 1518将代码写在组件的preInitialize事件监听器里面 简化 ... -
设置Flex组件的尺寸大小
2013-02-21 16:17 1533深红色部分标明了需注意的地方 另外要注意组件和容器的生命周 ... -
Flex minWidth minHeight
2013-02-04 16:17 1519minWidth 这个值并不是给组件自己用的,而是给组件的父容 ... -
ActionScript遍历绑定(BindProperty,BindSetter,ChangeWatcher)
2013-02-01 10:11 2446注意: 为防止内存益处,记得调用watcherInstance ... -
Flex程序适应不同屏幕尺寸和分辨率(滚动条)
2013-01-31 15:02 9763FlashBuilder编译后自动生成的xx.html里面定义 ... -
FlexContext, FlexClient,FlexSession
2013-01-15 15:05 2372使用了BlazeDS后,可以从FlexContext中获取一系 ... -
防止RemoteObject批处理AMF消息
2013-01-14 17:01 1256问题描述: 如果你在短时内调用同一个java对象上的两个方法, ... -
自动检测http和https的RemoteObject
2013-01-13 10:30 1735package { import util.Bro ... -
flex浏览器相关辅组类
2012-12-06 13:39 1250package util { import flash. ... -
Flex可变参数带来的问题
2012-12-06 13:34 1489当你在flex的方法中用了可变参数后,你会发现这些参数传到ja ... -
flex如何通过类名称实例化对象
2012-11-30 13:52 2729Getting the class from an objec ... -
flexlib的treeGrid用法
2012-11-30 13:46 1269为了使用treeGrid,通常你需要定义自己的DataDesc ... -
自定义flex tree的DataDescriptor
2012-11-30 13:42 1406public class EnvironmentDataDes ... -
关于Boolean类型在flex与java中间传递的问题
2012-11-30 13:38 1253/** *为简化,只列举两个字段 */ publi ... -
给Flex的Tree赋值方式(XML和ArrayCollection)
2012-11-30 09:33 40221)方式一,mxml内嵌xml数据赋值方式,Embedded ... -
Custom Alert
2012-11-26 19:21 0<?xml version="1.0&qu ... -
Flex服务端分页
2012-11-14 17:00 1051Structure: model event ... -
Flex可携带数据的Aler组件(DataCarriableAlert)
2012-11-14 16:52 1311package component.alert { ...
相关推荐
Flex中导出当前DataGrid中的数据。生成一个Excel文件。资源为一个简单的应用。
在FLEX4中开发带有过滤功能的DATAGRID组件
flex中dataGrid导出数据到excel中,不存在乱码问题
Flex Builder4.5导入Excel和CSV文件到DataGrid中,并自定义DataGrid选中行的右键
flex组件之DataGrid高级用法实例源码
FLEX的一个DataGrid例子,熟悉一下DataGrid的使用
Flex4.5之DataGrid表格组件的运用,从建立,到属性设置,自定义设置皮肤,很详细
flex中的datagrid的分页定位以及高亮显示
FLEX4 s:dataGrid单元格弹出可文本,就是单击单元格弹出自己定义的一个组件,
基于bootstrap封装的表格组件,调用方式类似与easyui。提供分页,条件查询、高级搜索。
Flex, DataGrid, 插入子组件
flex支持拖拽的DataGrid,如果去查api来置一些属性将会比较麻烦,这个DataGrid可以获取拖拽的内容,这是一个application,可以直接运行
将flex中datagrid组件中数据导出到excel表格中。思路很简单,利用as将datagrid中的数据解析出来,传到后台java服务端处理,即可保存为excel文件。
C#读取XML文件并将其内容显示在DataGrid组件中。可以学习一下如何使用C#读取XML中的节点数据,并将数据内容捆绑在DataGrid列表控件中,本例虽然简单,但在C#应用中是相当广泛的。
FLEX的datagrid合计、平均值,很好的例子代码拿来就可以用
flex-datagrid中,双击选中的数据,自动把数据移动到另一个datagrid里 希望可以帮助新的新手!
Flex的DataGrid中使用CheckBox. 大家共同研究
flex 三状态多选 自动分页DataGrid
能补充DataGrid的了解
creationComplete="service.send()" > <![CDATA[ import mx.controls.Alert; import mx.rpc.events.FaultEvent;... <mx:DataGrid width="300" dataProvider="{slides}"/> </mx:Application>