【问题标题】:Dojo gridx occasionally displaying rows in the wrong orderDojo gridx 偶尔会以错误的顺序显示行
【发布时间】:2018-06-12 06:01:48
【问题描述】:

我正在使用 IBM Content Navigator 2.0.3 附带的 Dojo 和 dojo/gridx。

网格数据来自我自己的全局数组,我正在将其用于其他事情。

大多数时候,一切都很好。但有时这些行会乱序显示。例如,代替预期的顺序 {0, 1, 2, 3, 4, 5, 6...},它将显示行 {5, 0, 2, 3, 4, 1, 6, ...}。这就像行以某种方式被“交换”。

我不知道为什么 - 是什么导致了这种行为。

当我在Chrome开发者工具中查看gridx store的时候,顺序是OK的:

  - this.grid.store:
  add:ƒ ()
  data:Array(11)
    0:{mappedName: "FNOL Email.html", claimNumber: "K00000133690", description: "FNOL", documentType: "", contentRcvDate: "06/11/2018", …, "A1001001A18F11B80705D00000"}
    1:{mappedName: "FNOLAck.msg", claimNumber: "K00000133690", description: "FNOL Acknowledge", documentType: "", contentRcvDate: "06/11/2018", …, "A1001001A18F11B80802G00002"}
    2:{mappedName: "imagefile.gif", claimNumber: "K00000133690", description: "Claim FNOL for Smithers", documentType: "", contentRcvDate: "06/11/2018", …, "A1001001A18F11B80903A00004"}
    3:{mappedName: "2-imagefile.gif", claimNumber: "K00000133690", description: "COR INS16", documentType: "", contentRcvDate: "06/11/2018", …, "A1001001A18F11B81002A00006"}
    4:{mappedName: "MSOutlookMessage.msg", claimNumber: "K00000133690", description: "MSOutlookMessage", documentType: "", contentRcvDate: "06/11/2018", …, "A1001001A18F11B81056G00008"}
    5:{mappedName: "MSWord.doc", claimNumber: "K00000133690", description: "signed medical authorization", documentType: "", contentRcvDate: "06/11/2018", …, "A1001001A18F11B81148F00010"}
    6:{mappedName: "PDF Document.pdf", claimNumber: "K00000133690", description: "Incident Report", documentType: "", contentRcvDate: "06/11/2018", …, "A1001001A18F11B81228B00012"}
   ...

商店的索引顺序也正确:

  idProperty:"cm8DocId"
  index:
    A1001001A18F11B80705D00000:0
    A1001001A18F11B80802G00002:1
    A1001001A18F11B80903A00004:2
    A1001001A18F11B81002A00006:3
    A1001001A18F11B81056G00008:4
    A1001001A18F11B81148F00010:5
    A1001001A18F11B81228B00012:6
    ...

但是行在网格上显示是乱序的。

当我在 Chrome 开发者工具中查看 HTML 元素时(例如:<div class="gridxRow" role="row" rowid="A1001001A18F11B81148F00010" rowindex="0"...>),索引 5 显示为顶行,rowindex 0。等等。

问:您知道为什么会发生这种情况吗?

问:对故障排除有何建议?

提前谢谢你!

【问题讨论】:

  • 您是否按任何列排序?也许是在第二次刷新网格时还是什么?

标签: dojo dojo.gridx ibm-content-navigator


【解决方案1】:

我从包含我的网格的 Dojo 小部件中清理了一些无关的“导入”......并且问题“消失了”:

define([
 "dojo/_base/declare",
 "dojo/_base/lang",
 "dojo/_base/connect",
 "dojo/dom-style",
 "dijit/_WidgetBase",
 "dijit/_TemplatedMixin",
 "dijit/_Contained",
 "dijit/_WidgetsInTemplateMixin",
 "ecm/model/Request",
 "dijit/layout/ContentPane",
 "gridx/Grid",
 //"gridx/core/model/cache/Sync",
 "dojo/store/Observable",
 "dojo/store/Memory",
 "gridx/modules/select/Row",
 "gridx/modules/extendedSelect/Row",
 "gridx/modules/IndirectSelect",
 "gridx/modules/RowHeader",
 //"gridx/modules/ColumnResizer",
 //"gridx/modules/SingleSort",
 //"gridx/modules/move/Row",
 "gridx/modules/VirtualVScroller",
 "ecm/widget/dialog/BaseDialog",
 //"ecm/widget/_MoveUpDownGridxMixin", 
 "ecm/widget/Button",
 "ecm/widget/CheckBox",
 "myPluginDojo/CustomDownloadDef",  
 "myPluginDojo/CustomPrintCCD",  
 "myPluginDojo/ManifestDef",
 "dojo/text!./templates/ManifestGridWidget.html"

 ],
 function (declare, lang, connect,domStyle, _WidgetBase, _TemplatedMixin, _Contained, _WidgetsInTemplateMixin, 
     Request, ContentPane, Grid, Observable, Memory, SelectRow, ExtendedSelectRow, IndirectSelect, 
     RowHeader,  VirtualVScroller, BaseDialog, Button, CheckBox, 
     CustomDownloadDef, CustomPrintCCD, ManifestDef, template) {    
 return declare("myPluginDojo.ManifestGridWidget", [BaseDialog, _WidgetBase, _TemplatedMixin, _Contained, _WidgetsInTemplateMixin], {
     ...

即使我的代码没有明确使用其中任何一个......从小部件定义(并且可能是从运行时环境)中删除不需要的“导入”似乎可以解决问题(?)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-09
    相关资源
    最近更新 更多