var xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET",urls,false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
var t = xmlDoc.getElementsByTagName("FeatureCollection");
var store = new Ext.data.SimpleStore({
fields: [
'vendor'
]
});
var reload = function() {
store.loadData(t);
}
setInterval(reload , 5000);
现在将此数据添加到Ext Js窗口:
var window = new Ext.Window({
title: "",
width: 200,
height:200,
layout: "fit",
collapsible: true,
autoScroll:true,
maximizable: true,
items: [
{
id:'legend-panel',
xtype: "grid",
ref: "capsGrid", // makes the grid available as app.capsGrid
title: "Sites",
region: "north",
height: 100,
viewConfig: {forceFit: true},
store: store,
columns: [
{header: 'Vendor', width: 200, sortable: true, dataIndex: 'vendor'}
]
}
]
});
现在,我如何在特定时间间隔刷新窗口而不是页面?
答案 0 :(得分:1)
试试这个:
var reload = function() {
store.loadData(t);
}
setInterval(reload, 1000);