You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
2.2 KiB
JavaScript

10 months ago
var id = "";
var cid = "";
var tid = "";
Ext.onReady(function () {
id = UrlParm.parm("id");
cid = UrlParm.parm("cid");
tid = UrlParm.parm("tid");
fnGetList();
setInterval(function () {
document.getElementById("listUL").innerHTML = "";
fnGetList();
}, 120000) //每1000毫秒(即1秒) 执行一次本段代码
});
function fnGetList() {
var _store = Ext.create('DsExt.ux.RefTableStore', {
fields: [
{ name: 'GID', type: 'string' },
{ name: 'TITLE', type: 'string' },
{ name: 'URL', type: 'string' },
{ name: 'CONTENT', type: 'string' }
],
proxy: { url: '/MvcShipping/MsTemplet/GetLayShowList' },
scope: this
});
_store.load({ params: { id: id, companyid: cid, templetid: tid} });
var newElement;
_store.on("load", function (_store) {
for (var i = 0; i < _store.getCount(); i++) {
if (i == 0) {
document.getElementById("msgTitle").innerHTML = "<a href='javascript:window.open(\"" + _store.getAt(i).get("URL") + "\",\"AnnouncePage\",\"height=520, width=700, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no\")' class='titleLinkContent'>" + _store.getAt(i).get("TITLE") + "</a>";
document.getElementById("msgContent").innerHTML = "<a href='javascript:window.open(\"" + _store.getAt(i).get("URL") + "\",\"AnnouncePage\",\"height=520, width=700, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no\")' class='summaryLinkContent'>" + _store.getAt(i).get("CONTENT") + "</a>";
}
else {
newElement = document.createElement("li");
newElement.setAttribute("class", "listLI");
newElement.innerHTML = "<a href='javascript:window.open(\"" + _store.getAt(i).get("URL") + "\",\"AnnouncePage\",\"height=520, width=700, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no\")' class='liLinkContent'>" + _store.getAt(i).get("TITLE") + "</a>";
document.getElementById("listUL").appendChild(newElement);
}
}
});
}