|
发表于 2014-7-14 16:07:56
|
显示全部楼层
如果是ms office的文档可以使用officeviewer组件显示,其它文档就看浏览器是否支持了
拖放officeviewer组件到w设计器中,可以只占上半部分使用officeviewer打开文档的方法如下
1、打开文件系统中的文档的方法
mainActivity.officeViewer1Ready = function(event){
event.source.openDocByGet("e:/ocxt/abc.doc");
};
2、打开文档服务器里面的文档的方法
需要引用docUtil2.js
<xhtml:script id="htmlScript2" src="/UI/system/service/doc/docUtil2.js"></xhtml:script>
打开文档
mainActivity.trigger1Click = function(event){
var fileID = justep.xbl("dataMain").getValue("sFileID");
var docPath = justep.xbl("dataMain").getValue("sDocPath");
var url = justep.Doc2.getdocServerAction(docPath, "/repository/file/cache/office/"+fileID);
url = url.indexOf(window.location.protocol) < 1 ? url : window.location.protocol+"//"+ window.location.host + url;
var offiveViewer = justep.xbl("officeViewer1");
offiveViewer.openDoc(url,"Word.Application",{"FileID":fileID,"FileExt":".docx"});
};
|
|