【问题标题】:when i move to next page in the dojo dataGrid, Rows are automatically got selected(the rows which are selected in first page)当我移动到 dojo dataGrid 中的下一页时,会自动选择行(在第一页中选择的行)
【发布时间】:2013-04-12 12:23:17
【问题描述】:

在我的 dojo dataGrid 中,例如,如果我在第一页中选择第 7 行和第 8 行,并且如果我通过使用分页功能移动到第二页。行(在第一页中选择的第 7 行和第 8 行)在第二页中也默认选择。 这是我的网格:

var grid = new dojox.grid.EnhancedGrid({
id: 'linesGrid',
style: 'width:950px;height:250px;',
store: store,
structure: layout,
rowSelector: '20px',
plugins: {
  indirectSelection: {headerSelector:true, width:"40px", styles:"text-align: center;"},
  pagination: {
      pageSizes: ["25", "50", "100", "All"],
      description: true,
      sizeSwitch: true,
      pageStepper: true,
      gotoButton: true,
              /*page step to be displayed*/
      maxPageStep: 4,
              /*position of the pagination bar*/
      position: "bottom"
  }
}
}, document.createElement('div'));

【问题讨论】:

    标签: dojo dojox.grid.datagrid


    【解决方案1】:

    将网格设置为 keepSelection : true。这将保持选择的正确行。

    【讨论】:

    • 嗨@CptAJ 我必须添加这一行。
    【解决方案2】:

    在显示下一页之前,您需要先发送yourGrid.selection.deselectAll();

    编辑:

    这里也讨论了这个问题的一部分:

    not able to call a function on pagination dojo enhancedGrid

    【讨论】:

    • 我必须在哪里添加这一行?因为,我认为分页不会在我的控制范围内,对吧?我的意思是当我点击下一页时,我不知道添加上面的代码会执行哪个代码......
    • 当你点击 nextPage 时,分页器插件的 nextPage 函数会被调用。还有其他功能,例如 firstpage gotopage 等。您可以使用“dojo aspect after”将功能连接到另一个功能。您可以使用“dojo aspect after”将我发布到下一页功能的线路连接起来。
    • 网格在访问商店时会抛出一个事件,也许您可​​以监听该事件并添加取消选择行...
    • 我搜索了整个网络。我没有得到事件,它将在分页时调用,我尝试使用下面的代码但它不是 wrkng.. grid.on("SetStore", function(evt) { alert("store changes"); }, true);
    猜你喜欢
    • 2016-05-02
    • 1970-01-01
    • 2011-11-27
    • 2011-07-01
    • 2012-08-11
    • 2022-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多