SmartGwt ListGrid.setAlwaysShowEditors(true) 问题

发布于 2024-12-12 11:45:03 字数 1728 浏览 0 评论 0 原文

我们有基本的 ListGrid,其中一个字段是可编辑的,并且始终应显示该字段的编辑器,这是创建代码,

ListGrid listPanel = new ListGrid();
listPanel.setDataFetchMode(FetchMode.PAGED);
listPanel.setDataSource(datasource);
listPanel.setAutoFetchData(true);
listPanel.setAlwaysShowEditors(true);
listPanel.setCanEdit(true);
listPanel.setAutoSaveEdits(false);
listPanel.setSaveByCell(false);
listPanel.setEditOnFocus(true);
listPanel.setEditEvent(ListGridEditEvent.CLICK);

在此处创建可编辑字段

ListGridField manualScoreColumn = new ListGridField("score", "Score");
manualScoreColumn.setType(ListGridFieldType.INTEGER);
manualScoreColumn.setCanEdit(true);
manualScoreColumn.setValidateOnChange(true);
manualScoreColumn.setValidators(new IntegerRangeValidator());

问题是当使用 ListGrid 中的数据进行过滤时,

listPanel.setCriteria(criteria);

我们得到这样的例外

12:42:31.204:RDQ2:WARN:Log:TypeError: _5 is null
ListGrid._clearingInactiveEditorHTML() @ adminApp/sc/modules/ISC_Grids.js:1530
GridBody.redraw(_1=>false) @ adminApp/sc/modules/ISC_Grids.js:889
[c]Canvas.clearRedrawQueue() @ adminApp/sc/modules/ISC_Core.js:3300
[c]Class.fireCallback(_1=>{Obj},  _2=>undef,  _3=>[object Array],  _4=>{Obj}, _5=>true)
@ adminApp/sc/modules/ISC_Core.js:299
Timer._fireTimeout("$ir2251") @ adminApp/sc/modules/ISC_Core.js:1269
unnamed() @ adminApp/sc/modules/ISC_Core.js:1264
unnamed() @ 

我在此处此处但没有提出解决方案。

有任何解决方法吗? 谢谢。

We have basic ListGrid where one of the fields is editable and editor for this field always should be displayed, here is creation code

ListGrid listPanel = new ListGrid();
listPanel.setDataFetchMode(FetchMode.PAGED);
listPanel.setDataSource(datasource);
listPanel.setAutoFetchData(true);
listPanel.setAlwaysShowEditors(true);
listPanel.setCanEdit(true);
listPanel.setAutoSaveEdits(false);
listPanel.setSaveByCell(false);
listPanel.setEditOnFocus(true);
listPanel.setEditEvent(ListGridEditEvent.CLICK);

editable field is created here

ListGridField manualScoreColumn = new ListGridField("score", "Score");
manualScoreColumn.setType(ListGridFieldType.INTEGER);
manualScoreColumn.setCanEdit(true);
manualScoreColumn.setValidateOnChange(true);
manualScoreColumn.setValidators(new IntegerRangeValidator());

problem is when data in ListGrid is filtred using

listPanel.setCriteria(criteria);

we get such exeption

12:42:31.204:RDQ2:WARN:Log:TypeError: _5 is null
ListGrid._clearingInactiveEditorHTML() @ adminApp/sc/modules/ISC_Grids.js:1530
GridBody.redraw(_1=>false) @ adminApp/sc/modules/ISC_Grids.js:889
[c]Canvas.clearRedrawQueue() @ adminApp/sc/modules/ISC_Core.js:3300
[c]Class.fireCallback(_1=>{Obj},  _2=>undef,  _3=>[object Array],  _4=>{Obj}, _5=>true)
@ adminApp/sc/modules/ISC_Core.js:299
Timer._fireTimeout("$ir2251") @ adminApp/sc/modules/ISC_Core.js:1269
unnamed() @ adminApp/sc/modules/ISC_Core.js:1264
unnamed() @ 

I've found similar question here and here but no solution was proposed.

Are there any workarounds ? Thanks.

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

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

发布评论

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

评论(1

蝶舞 2024-12-19 11:45:03

确保您已将 ListGridField 设置为 ListGrid

 listPanel.setFields(manualScoreColumn);

将您选择的编辑器设置为 ListGridField 的另一种方法是使用 setEditorType 方法

    ListGrid listPanel = new ListGrid();
    listPanel.setCanEdit(true);
    listPanel.setAutoSaveEdits(false);

    //You can use any formitem instead of date item,Say TextItem,SelectItem etc
    DateItem dateItem = new DateItem();
    ListGridField dateListGridField= new ListGridField("date", "Date");
    dateListGridField.setEditorType(dateItem);
    listPanel.setFields(dateListGridField);

Make sure you have set ListGridField to ListGrid

 listPanel.setFields(manualScoreColumn);

Another way to set editor of your choice to ListGridField is to use setEditorType method

    ListGrid listPanel = new ListGrid();
    listPanel.setCanEdit(true);
    listPanel.setAutoSaveEdits(false);

    //You can use any formitem instead of date item,Say TextItem,SelectItem etc
    DateItem dateItem = new DateItem();
    ListGridField dateListGridField= new ListGridField("date", "Date");
    dateListGridField.setEditorType(dateItem);
    listPanel.setFields(dateListGridField);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文