GWT为移动设备定制CellList多选模型 [英] GWT Customize CellList Multi-Selection Model for Mobile Devices

查看:146
本文介绍了GWT为移动设备定制CellList多选模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用MultiSelectionModel的应用程序,它运行良好,但我需要我正在开发的用于移动设备的网站,因此我无法使用键盘来协助选择元素(因为它不存在)。 EX:在桌面上,我只需按住ctrl并点击所有我想选择的元素。



因此,在移动设备上,我想修改默认行为MultiSelectionModel,这样当你点击一个CellList项目时,它将切换该项目的选择状态。


我已经查看了它的源代码,并且无法看到实现我需要的行为。 (Mobile MultiSelection)。

I have an application, that uses the MultiSelectionModel, and it works great, but I need the site I'm developing to work on mobile devices, and so I can't use the keyboard to assist in selecting the elements (since it doesn't exist). EX: On the desktop I just hold ctrl and click on all the element that I want to select.

So on the mobile device, I would like to modify the default behavior of the MultiSelectionModel so that when you click on a CellList item, it toggles the selection state of that item.

I have looked through the source for it and cannot see anyway to implement the behavior that I need. (Mobile MultiSelection).

推荐答案

无论您是否添加复选框,您都必须添加单元格预览处理程序。定义一个最简单的方法是使用 DefaultSelectionEventManager ,可以使用复选框管理器与复选框列组合,或创建一个自定义的(您可以将点击事件映射到切换操作)。

Whether you add a checkbox column or not, you'll have to add a cell preview handler. The easiest way to define one is to use DefaultSelectionEventManager, either using a checkbox manager in combination with a checkbox column, or creating a custom one (you'd map a click event into a toggle action).

您可以在 GWT Showcase ;它使用带有两个参数的 setSelectionModel overload同时添加 CellPreviewEvent.Handler

You can see it used, the checkbox variant, in the GWT Showcase; it uses the setSelectionModel overload with two arguments to add the CellPreviewEvent.Handler at the same time.

这篇关于GWT为移动设备定制CellList多选模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆