FieldMultiBrowser_wev8.js
2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
function showMultiDocDialog(selectids,srchead,titleviewtype,detailtable,pkfield, formid){
var config = null;
config= rightsplugingForBrowser.createConfig();
config.srchead=srchead;
config.container =$("#colShow");
config.searchLabel="";
config.hiddenfield="fieldid"; //原来只有主表的时候用id 现在加入明细表后用id_did 主表id_明细表id 别名取为hiddenfield
//config.hiddenfield="hiddenfield";
config.pkfield=pkfield;//添加属性pkfieldid 作为带出到表单上的字段
config.titleviewtype=titleviewtype;
config.detailtable=detailtable;
config.saveLazy = true;
config.srcurl = "/formmode/form/FieldMultiBrowserAjax.jsp?src=src&formid="+formid+"&selectids="+selectids;
config.desturl = "/formmode/form/FieldMultiBrowserAjax.jsp?src=dest&formid="+formid+"&selectids="+selectids;
config.pagesize = 10;
config.formId = "frmmain";
config.selectids = selectids;
config.searchAreaId = "e8QuerySearchArea";//新版自定义多选框微调增加
config.formatCallbackFn = function(config,destMap,destMapKeys){
var ids="",names="";
var nameKey = destMap["__nameKey"];
for(var i=0;destMapKeys&&i<destMapKeys.length;i++){
var key = destMapKeys[i];
var dataitem = destMap[key];
var name = dataitem[nameKey];
var obj = null;
try{
obj = jQuery(name);
}catch(e){}
if(ids==""){
ids = key;
}else{
ids = ids+","+key;
}
if(names==""){
names = (obj && obj.length>0)?obj.text().replace(/\,/g,""):name;
}else{
names=names + ","+((obj && obj.length>0)?obj.text().replace(/\,/g,""):name);
}
}
return {id:ids,name:names};
}
try{
config.dialog = dialog;
}catch(e){}
jQuery("#colShow").html("");
rightsplugingForBrowser.createRightsPluing(config);
jQuery("#btnok").bind("click",function(){
rightsplugingForBrowser.system_btnok_onclick(config);
});
jQuery("#btnclear").bind("click",function(){
rightsplugingForBrowser.system_btnclear_onclick(config);
});
jQuery("#btncancel").bind("click",function(){
rightsplugingForBrowser.system_btncancel_onclick(config);
});
jQuery("#btnsearch").bind("click",function(){
rightsplugingForBrowser.system_btnsearch_onclick(config);
});
}
function btnOnSearch(){
jQuery("#btnsearch").trigger("click");
}