如何在 Gxt 3.1.1 中获取 checkBox readOnly 状态,就像在 gxt 3.0.0 中有 isReadOnly() 方法一样?

How to get checkBox readOnly state in Gxt 3.1.1 like there is isReadOnly() method in gxt 3.0.0?

我正在尝试使用 Gxt 3.1.1 在我的项目中实现如下代码:

CheckBox checkBx = new CheckBox();
checkBx.setReadOnly(False);

System.out.println(checkBx.isReadOnly());

虽然此代码段将在 Gxt 3.0.0 上运行良好,但在 3.1.1 中它显示最后一行不受支持。也没有获取 ReadOnly 状态的方法。我该如何实现此类功能的任何方法?

这是对 3.0.3 的 API 更改(参见 https://docs.sencha.com/gxt/3.1/announcements/release_notes.html):

Backwards incompatible - CheckBox and Radio no longer support setting the readOnly attribute (only supported by text and passwords inputs)

您可以改用 setEnabled()isEnabled()