我使用的是tableToGrid特性和viewGridRow特性。调用viewGridRow方法时,对话框将正确显示。但是,当使用分页按钮浏览记录时,或者当您关闭对话框并对另一个记录执行viewGridRow方法时,名称中包含空格(“")的所有列的值都不会更新。它们保留第一次执行viewGridRow时放在那里的值。名称中没有空格的所有列的值都会按应该的方式更新。
我尝试过recreateForm:true (尽管这是editGridRow方法的属性,而不是viewGridRow方法的属性),但没有解决问题。我还尝试了其他设置的各种半随机组合。
下面是我的代码。想法?
tableToGrid("#mytable", height:'400',
ondblClickRow: function(rowid,iRow,iCol,e) {
jQuery("#mytable").viewGridRow(rowid, {closeOnEscape:true});
}
});
<table id="mytable">
<thead>
<tr class="header">
<th id="CustomerID">CustomerID</th>
<th id="Account ID">Account ID</th>
<th id="Customer">Customer</th>
<th id="System">System</th>
<th id="Make/Model">Make/Model</th>
<th id="Modality">Modality</th>
<th id="Last Login">Last Login</th>
<th id="Attachments">Attachments</th>
<th id="Alerts">Alerts</th>
<th id="Last Log Entry">Last Log Entry</th>
<th id="Last HE Level">Last HE Level</th>
<th id="HE Level Threshold">HE Level Threshold</th>
<th id="DBOD Threshold">DBOD Threshold</th>
<th id="HE Data Latency">HE Data Latency</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>32222222</td>
<td>ABC Company</td>
<td>Smith Warehouse Bay #1</td>
<td>Make/Model</td>
<td>MRI</td>
<td>Dec 20 2010 12:18PM by Frank Smith</td>
<td>0</td>
<td>0</td>
<td></td>
<td></td>
<td>60</td>
<td>0.35</td>
<td></td>
</tr>
…
</tbody>
</table>发布于 2011-02-10 05:29:10
您的错误在于,您显式地为转换为jqGrid的<table>的<th>元素定义了is。如何从tableToGrid函数的源代码中看到(最有趣的是the lines 37-38,如果存在的话,name和index列属性将从<th>元素中获取。带有空格的in不受jqGrid支持,因为它们在许多jQuery选择器中不起作用。
请阅读the reference,它描述了CSS标识符中的限制。你应该遵守这些限制。
因此,我建议您只从<th>元素中删除id属性,或者为id选择不带空格的其他值。
https://stackoverflow.com/questions/4948643
复制相似问题