[removed]
<!--
var listenerFieldsEditCount = 0;
jq(function(){
_listener_event_type=jq('#listenerEventType').combobox({
editable:false
});
_task_listener_fields_dg=jq('#task-listeners-fields-list').datagrid({
//title:"Listener",
//url:'${ctx}/wf/procdef/procdef!search.action',//加载表格数据的URL
singleSelect:true,
width:600,
height:300,
iconCls:'icon-edit',
//fit:true,
//idField:'id',
//pagination:true,
//pageSize:15,
//pageNumber:1,
//pageList:[10,15],
rownumbers:true,
//sortName:'id',
//sortOrder:'asc',
striped:true,
toolbar:[{
text:'New',
iconCls:'icon-add',
handler:function(){
if(listenerFieldsEditCount>0){
jq.messager.alert("error","有可编辑的单元格,不能添加!",'error');
return;
}
jq('#task-listeners-fields-list').datagrid('appendRow',{
id:'',
fieldName:'',
type:'',
value:'',
action:''
});
var index = jq('#task-listeners-fields-list').datagrid('getRows').length-1;
jq('#task-listeners-fields-list').datagrid('beginEdit', index);
}
}],
onDblClickRow:function(rowIndex,rowData){
editListenerField(rowIndex);
},
onBeforeEdit:function(index,row){
row.editing = true;
jq(this).datagrid('refreshRow', index);
listenerFieldsEditCount++;
},
onAfterEdit:function(index,row){
row.editing = false;
jq(this).datagrid('refreshRow', index);
listenerFieldsEditCount--;
},
onCancelEdit:function(index,row){
row.editing = false;
jq(this).datagrid('refreshRow', index);
listenerFieldsEditCount--;
}
});
jq('#fieldSaveBt').linkbutton({
iconCls:"icon-save"
});
jq('#fieldCancelBt').linkbutton({
iconCls:"icon-cancel"
});
jq("#listenerServiceClass").autocomplete(_process_def_provided_listeners, {
width: 450,
minChars: 0,
max: 10,
autoFill: true,
mustMatch: false,
matchContains: false,
scrollHeight: 220,
//multiple: true,
//multipleSeparator: " ",
scroll: true
});
populateListenerProperties();
});
function changeListenerServiceType(obj){
if(obj.value=='javaClass'){
jq('#listenerServiceLabel').html('Service Class:');
jq('#listenerServiceClass').show();
jq('#listenerServiceExpression').hide();
}else if(obj.value=='expression'){
jq('#listenerServiceLabel').html('Expression:');
jq('#listenerServiceClass').hide();
jq('#listenerServiceExpression').show();
}
}
function listenerFieldsActionFormatter(value,rowData,rowIndex){
var id = rowIndex;
var s='<img onclick="saveListenerField('+id+')" src="../../image/ok.png" title="'+"确定"+'" style="cursor:hand;"/>';
var c='<img onclick="cancelListenerField('+id+')" src="../../image/cancel.png" title="'+"取消"+'" style="cursor:hand;"/>';
var e='<img onclick="editListenerField('+id+')" src="../../image/modify.png" title="'+"修改"+'" style="cursor:hand;"/>';
var d='<img onclick="deleteListenerField('+id+')" src="../../image/delete.gif" title="'+"删除"+'" style="cursor:hand;"/>';
if(rowData.editing)
return s;
else
return e+' '+d;
}
function cancelListenerField(id){
_task_listener_fields_dg.datagrid('cancelEdit', id);
}
function editListenerField(id){
_task_listener_fields_dg.datagrid('beginEdit', id);
}
function saveListenerField(id){
//alert(id);
_task_listener_fields_dg.datagrid('endEdit', id);
//alert(editcount);
}
function deleteListenerField(id){
_task_listener_fields_dg.datagrid('deleteRow',id);
refreshAllListenerFields();
}
function refreshAllListenerFields(){
var rs = _task_listener_fields_dg.datagrid('getRows');
for(var i=0;i
0){
jq.messager.alert("error","",'error');
return null;
}
var insertRows = _task_listener_fields_dg.datagrid('getChanges','inserted');
var updateRows = _task_listener_fields_dg.datagrid('getChanges','updated');
var deleteRows = _task_listener_fields_dg.datagrid('getChanges','deleted');
var changesRows = {
inserted : [],
updated : [],
deleted : []
};
if (insertRows.length>0) {
for (var i=0;i0) {
for (var k=0;k0) {
for (var j=0;j0){
jq.messager.alert("error","请先保存可编辑的表格!",'error');
return;
}
if(listenerId != "" && listenerId != null && listenerId!="null"&&listenerId;!="NULL"){
var listener = getExsitingListener();
var r = updateExistingListener(listener);
if(!r)return;
}else{
var listener = createNewListener();
var r = insertNewListener(listener);
if(!r)return;
}
_listener_win.window('close');
}
function insertNewListener(listener){
listener.event=_listener_event_type.combobox('getValue');
jq('input[name="listenerServiceType"]').each(function(i){
if(this.checked){
listener.serviceType=this.value;
return false;
}
});
listener.serviceClass=jq('#listenerServiceClass').val();
listener.serviceExpression=jq('#listenerServiceExpression').val();
var changesRows = getListenerFieldsGridChangeRows();
if(changesRows == null)return false;
var insertRows = changesRows['inserted'];
if (insertRows.length>0) {
for (var i=0;i0) {
for (var i=0;i0) {
for (var k=0;k0) {
for (var j=0;j
Event: |
|
|
<input type="radio" id="listenerServiceType" name="listenerServiceType" value="javaClass" checked="checked" Class
<input type="radio" id="listenerServiceType" name="listenerServiceType" value="expression"
|
Service Class: |
<input type="text" id="listenerServiceClass" name="listenerServiceClass" size="80" value=""/>
<input type="text" id="listenerServiceExpression" name="listenerServiceExpression" size="80" none;" value=""/>
|
Fields: |
|
Field Name |
Type |
Value |
Action |
|
|