Flex AdvancedDataGrid 多单元格选择突出显示未完全清除
我有两个问题,第二个只是一个问题,因为这是解决第一个问题的可能方法!
我正在开发一个 Flex 4.1 应用程序,使用 Spark 主题:我无法更改这些;光环不是一个选择。
它提供了通过单次按键用单个字符填充 AdvancedDataGrid 的多个选定单元格的功能。因此,用户使用 Shift 键选择单元格,点击 H(例如),然后看到所有单元格都随着 H 更新,而不使用 itemEditor,而是通过网格 keyDown 事件。然后他们点击其他地方,选择就会被清除。
然而,可见的选择并未完全清除,并且新着色的单元格不会全部改变其选定的颜色。
在下面我可以验证选择是否已清除:mygrid.selectedCells 为空。之后的所有行为都指向网格的某种显示故障:单元格不再被选中,但它们看起来像被选中。
在选定的单元格上按键后:
单击鼠标以清除选择后:
注意交替的列:这总是发生的方式。
这是使用默认的 itemRenderer。对于一个非常基本的自定义 itemRenderer 仍然会发生这种情况,但我没有进一步研究这个途径,因为有一个复杂的情况,我无法让 itemRenderer 中的标签识别backgroundAlpha,因此“选定”背景几乎不可见并且看起来很糟糕。我在某处读到这是 Spark 的一个问题,而且如果我切换回默认渲染器,一切都很好。嗯...除了这个选择颜色的故障。
这是使用自定义渲染器的外观:
如果我遗漏了一些明显的东西,这是我尝试过的 itemRenderer:
<?xml version="1.0" encoding="utf-8"?>
<s:MXAdvancedDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
focusEnabled="true" autoDrawBackground="true"
>
<s:layout>
<s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
</s:layout>
<s:Label id="lblData" text="{listData.label}" backgroundAlpha="0"/>
</s:MXAdvancedDataGridItemRenderer>
所以总之:我需要的是一种修复多重选择故障的方法;仅当我需要自定义 itemRenderer 来修复选择故障时,项目渲染器问题才成为问题。
非常感谢任何帮助。
I've two problems, the second of which is only an issue because it's a possible way to fix the first!
I'm developing a Flex 4.1 application, using a Spark theme: I can't change these; Halo isn't an option.
It's providing the facility to fill multiple-selected cells of an AdvancedDataGrid with a single character, from a single keypress. So the user selects their cells using the Shift key, hits H (for example) and sees all the cells update with H, without using an itemEditor but via grid keyDown events instead. Then they click somewhere else and the selection should clear.
However the visible selection isn't fully cleared and the newly coloured cells won't all change from their selected colour.
Underneath I can verify that the selection has cleared: mygrid.selectedCells is empty. All behaviour afterwards points to some kind of display glitch with the grid: The cells aren't selected any more but they look like they are.
After the keypress over the selected cells:
After the mouse-click away to clear the selection:
Note the alternating columns: this is always the way it happens.
This is using the default itemRenderer. It still happens with a very basic custom itemRenderer but I haven't looked further down this avenue because there's a complication that I can't get the label in the itemRenderer to recognise backgroundAlpha so the 'selected' background is barely visible and looks terrible. I read somewhere that this is a problem with Spark, and it's certainly true that if I switch back to the default renderer, all is fine. Well...except for this selection-colour glitch.
Here's how it looks with the custom renderer:
If I'm missing something obvious, here's the itemRenderer I tried:
<?xml version="1.0" encoding="utf-8"?>
<s:MXAdvancedDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
focusEnabled="true" autoDrawBackground="true"
>
<s:layout>
<s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
</s:layout>
<s:Label id="lblData" text="{listData.label}" backgroundAlpha="0"/>
</s:MXAdvancedDataGridItemRenderer>
So in summary: what I need is a way to fix the multiple selection glitch; the item renderer problem is only an issue if I need a custom itemRenderer to fix the selection glitch.
Any help gratefully received.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎是由 Flashplayer 10.1 引起的。您可以在此处找到详细信息:
ADG 选择错误
评论。
This appears to be caused by Flashplayer 10.1. You can find details here:
ADG selection bug
There is also a workaround posted in the comments.