只需双击即可弯曲树选择颜色

发布于 2024-09-10 21:59:30 字数 33 浏览 1 评论 0原文

我怎样才能在单击时禁用选择颜色并只需双击即可启用它。

How could i disable the selection color on single click and enable it just to double click.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

聊慰 2024-09-17 21:59:30

Flex 3 答案...

您需要扩展 Tree 类并重写 drawItem 方法以删除添加的突出显示子项。

就像

protected override function drawItem( item : IListItemRenderer, selected:Boolean = false, highlighted : Boolean = false, caret : Boolean = false, transition : Boolean = false ) : void {
    super.drawItem( item, selected, false, caret, transition );
}

然后为单击和双击添加侦听器一样简单,这些侦听器复制您在重写方法中阻止发生的突出显示代码的功能。

请注意,这并不会阻止实际选择的行,它只是改变突出显示,因此对于用户来说,突出显示丢失但仍然选择了一行可能会有点困惑。

Flex 3 answer...

You'll need to extend the Tree class and override the drawItem method to remove the highlight child that is added.

It's as easy as

protected override function drawItem( item : IListItemRenderer, selected:Boolean = false, highlighted : Boolean = false, caret : Boolean = false, transition : Boolean = false ) : void {
    super.drawItem( item, selected, false, caret, transition );
}

Then add listeners for clicks and doubleclicks that replicate the functionality of the highlight code you prevented happening in the overridden method.

Note this doesn't stop the row actually being selected, it just alters the highlight, so it may be a bit confusing for users to have the highlight missing but still have a row selected.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文