【发布时间】:2010-05-13 11:50:41
【问题描述】:
我有一个从 xml 流加载数据的 jqgrid(由 django 1.1.1 处理):
jQuery(document).ready(function(){
jQuery("#list").jqGrid({
url:'/downtime/list_xml/',
datatype: 'xml',
mtype: 'GET',
postData:{site:1,date_start:document.getElementById('datepicker_start').value,date_end:document.getElementById('datepicker_end').value},
colNames:[...],
colModel :[...],
pager: '#pager',
rowNum: 25,
rowList:[10,25,50],
viewrecords: true,
height: 500,
caption: 'Click on column headers to reorder'
});
$("#grid_reload").click(function(){
$("#list").trigger("reloadGrid");
});
$("#tabs").tabs();
$("#datepicker_start").datepicker({dateFormat: 'yy-mm-dd'});
$("#datepicker_end").datepicker({dateFormat: 'yy-mm-dd'});
...
还有html元素:
<th>Start Date:</th>
<td><input id="datepicker_start" type="text" value="2009-12-01"></input></td>
<th>End Date:</th>
<td><input id="datepicker_end" type="text" value="2009-12-03"></input></td>
<td><input id="grid_reload" type="submit" value="load" /></td>
当我单击 grid_reload 按钮时,网格会重新加载,但是当它这样做时,它会显示与以前完全相同的数据,即使测试 xml 以针对不同的时间戳返回不同的数据。
我已经使用 alert(document.getElementById('datepicker_start').value) 检查了在触发重新加载事件时日期输入中的值是否正确传递。
任何想法为什么数据不更新?可能是缓存或浏览器问题?
【问题讨论】: