|
|
本帖最后由 purple 于 2012-12-31 14:07 编辑
函数格式:
noneFlowPadding(paddingName, sql, fieldNames, width, height)
函数说明:
paddingName:待办任务名称
sql: SQL条件语句
fieldNames:名称
width:视图的宽度
height:视图的高度
示例:
实现noneFlowPadding(paddingName, sql, fieldNames, width, height)函数的应用
function noneFlowPadding(paddingName, sql, fieldNames, width, height) {
var w = "320px";
var h = "250px";
if (width) w = width;
if (height) h = height;
var datas = queryBySQL(sql);
var temp = "";
var value = "";
var count = 1;
var tempvalue = "";
if (datas.size() > 0) {
for (var it = datas.iterator(); it.hasNext();) {
var doc = it.next();
if (fieldNames.constructor == Array) {
count = fieldNames.length;
tempvalue = "";
for (var i = 0; i < count; i++) {
tempvalue += doc.getItemValueAsString(fieldNames) + " ";
}
} else {
tempvalue = doc.getItemValueAsString(fieldNames);
}
temp += '<tr class="table-text">' + '<td id="pd" nowrap="nowrap" onMouseOver="this.className=\'over\'" onMouseOut="this.className=\'out\'">' + '<img src="/obpm/resource/img/unRd.gif" alt="未读" name="isUnRdImg" id="qq"/>' + '<a href="javaScript:viewDoc(\'' + doc.getId() + '\',\'' + doc.getFormid() + '\',' + null + ')">' + tempvalue + ' </a></td></tr>';
}
value = '<div border=\'0\' style=\'margin-left:8px;background-color:white;height=' + h + '; width=' + w + ';overflow:auto\' ><link rel="stylesheet" href="/obpm/resource/css/main.css" type="text/css">' + '<div class="window list-table" style="margin:15px 10px 15px 10px;">' + '<div scope="col" class="column-head" scope="row" id="header" style="border: 0px solid #ffcc00;font-size: 13px;cursor:move;" background="">' + '<img alt="pending-head" id="image1" src="/obpm/resource/imgnew/pending01.gif" />' + '<font style="font-size: 14px;cursor: context">' + paddingName + '</font>' + '</div><div class="context"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>' + temp + '</tr></table>' + '</div><div class="title" align="right">' + '<span align="right">' + '</SPAN>第1页/小计1页 </span>' + '</div></div>';
value += '<script type="text/javascript">' + 'function viewDoc(docid, formid,reminderid) {' + 'if (docid && formid) {' + 'var viewDocURL = "/obpm/portal/dynaform/document/view.action?_currpage=1&_backURL=%2Fobpm%2Fportal%2Fdispatch%2Fhomepage.jsp&_rowcount=1&_pagelines=10";' + 'viewDocURL += "&_docid=" + docid;' + 'viewDocURL += "&_formid=" + formid;' + 'viewDocURL += "&reminderid=" + reminderid;' + 'window.location.href = viewDocURL;' + '}' + '}' + '</script></div>';
}
return value;
} |
|