【问题标题】:Couldn't update value of cell in jqgrid无法更新 jqgrid 中单元格的值
【发布时间】:2015-02-12 12:44:49
【问题描述】:

我已经尝试更新 jqgrid 中的一个单元格五个小时,但它还没有工作。

我用过:

  var StatusValue = $("#DocumentGrid").getCell(rows[i], "StatusLabel");
  if (StatusValue.toString() == "Affected")
              {
               StatusValue = "Attribué";

               alert(StatusValue);

               $("#DocumentGrid").jqGrid('setCell', 5, 'StatusLabel', 'Attribué');


               $("#DocumentGrid").jqGrid('getLocalRow', 5).DocumentGrid = 'Attribué';
               }

但是没用

我也试过这个代码http://decoder-log.blogspot.com/2013/03/change-cell-value-in-jqgrid.htmlHow to update value of data in jqgrid 但它们都不起作用。

enter code here

【问题讨论】:

  • 什么是5,您将其用作setCellgetLocalRow 的r​​owid?您使用rows[i] 获取数据,但将其更新为rowid=5。这是怀疑的。你想用代码做什么? 什么时候需要替换数据?在网格中加载数据后是否需要直接进行替换?您尝试使用 getLocalRow,它仅适用于 datatype: "local"。你用的是哪个datatypegetLocalRow 对更新内部数据 非常有效,但数据只有在*重新加载网格后才会显示。所以需要更多关于你做什么的细节。

标签: jquery jqgrid


【解决方案1】:

我是这样解决问题的

jQuery("#DocumentGrid").setCell(rows[i], 'StatusLabel', StatusValue);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-31
    • 1970-01-01
    • 2012-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-30
    相关资源
    最近更新 更多