提交 256b35c7 编写于 作者: U unknown

数据表格

上级 79bf462c
......@@ -149,6 +149,12 @@
"cursor": "move",
"float": "left"
},
"datatableMoveLineAction": {
"width": "5px",
"color": "#aaa",
"cursor": "pointer",
"float": "left"
},
"gridMoveLineDragNode": {
"opacity": 0.7,
"z-index": 30000,
......
......@@ -119,6 +119,12 @@
"cursor": "move",
"float": "left"
},
"datatableMoveLineAction": {
"width": "5px",
"color": "#aaa",
"cursor": "pointer",
"float": "left"
},
"gridMoveLineDragNode": {
"opacity": 0.7,
"z-index": 30000,
......
......@@ -1771,7 +1771,8 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
* "activityName": "申请人", //附件上传的活动名称
* "activityType": "manual", //附件上传的活动类型
* "site": "$mediaOpinion", //附件存储位置(一般用于区分附件在哪个表单元素中显示)
* "type": "image/png" //附件类型(contentType)
* "type": "image/png", //附件类型(contentType)
* "control": {}
* }]</code></pre>
*/
setData: function(data){
......@@ -2255,7 +2256,10 @@ MWF.xApplication.process.Xform.AttachmentDg = MWF.APPAttachmentDg = new Class({
// }.bind(this));
if(this.json.ignoreSite) {
( this._getBusinessData() || [] ).each(function (att) {
this.attachmentController.addAttachment(att);
var flag = this.form.businessData.attachmentList.some(function (attData) {
return att.id === attData.id;
}.bind(this));
if(flag)this.attachmentController.addAttachment(att);
}.bind(this));
}else{
this.form.businessData.attachmentList.each(function (att) {
......
......@@ -698,6 +698,17 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
this.fireEvent("completeLineEdit", [line]);
return true;
},
_moveUpLine: function(ev, line){
if( this.currentEditedLine && !this._completeLineEdit() )return false;
if( line.options.index === 0 )return;
var data = this.getData();
var upData = data.data[line.options.index-1];
var curData = data.data[line.options.index];
data.data[line.options.index] = upData;
data.data[line.options.index-1] = curData;
this.setData( data );
},
_changeEditedLine: function(line){
if( this.currentEditedLine ){
if( line === this.currentEditedLine )return;
......@@ -706,43 +717,6 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
line.changeEditMode(true);
this.currentEditedLine = line;
},
// _checkSelectAll: function () {
// debugger;
// var selectData = this.selectAllSelector.getData();
// var selected;
// if(o2.typeOf(selectData)==="array"){
// selected = selectData.contains(this.json.outerSelectAllSelectedValue);
// }else{
// selected = selectData === this.json.outerSelectAllSelectedValue;
// }
// this.selected = selected;
// this.lineList.each(function (line) {
// this.selected ? line.select() : line.unselect();
// }.bind(this))
// },
// selectAll: function(){
// this.selected = true;
// if(this.selectAllSelector)this.selectAllSelector.setData(this.json.outerSelectAllSelectedValue);
// },
// unselectAll: function(){
// debugger;
// this.selected = false;
// if( this.selectAllSelector.getOptionsObj ){
// var options = this.selectAllSelector.getOptionsObj();
// var value = "";
// var arr = options.valueList || [];
// for( var i=0; i<arr.length; i++ ){
// var v = arr[i];
// if( v !== this.json.outerSelectAllSelectedValue ){
// value = v;
// break;
// }
// }
// this.selectAllSelector.setData(value);
// }else{
// this.selectAllSelector.setData("")
// }
// },
editValidation: function(){
var flag = true;
......@@ -1449,7 +1423,7 @@ MWF.xApplication.process.Xform.DatatablePC.Line = new Class({
if(!this.options.isEditable)return;
var editActionTd = this.node.getElement(".mwf_editaction");
//this.moveActionTd = this.node.getElement(".moveAction");
var moveActionTd = this.node.getElement(".mwf_moveaction");
if(this.datatable.multiEditMode){ //多行编辑模式
if(this.options.isAddable)this.createAddAction(editActionTd);
......@@ -1461,6 +1435,7 @@ MWF.xApplication.process.Xform.DatatablePC.Line = new Class({
this.createCancelEditAction(editActionTd);
this.checkActionDisplay();
}
this.createMoveAction(moveActionTd);
},
checkActionDisplay: function(){
......@@ -1521,6 +1496,19 @@ MWF.xApplication.process.Xform.DatatablePC.Line = new Class({
}
}).inject(td);
},
createMoveAction: function(td){
this.moveAction = new Element("div", {
"styles": this.form.css.datatableMoveLineAction,
"text": "",
"events": {
"click": function(ev){
this.datatable._moveUpLine( ev, this );
// if( this.datatable.currentEditedLine === this )this.datatable.currentEditedLine = null;
ev.stopPropagation();
}.bind(this)
}
}).inject(td);
},
changeEditMode: function( isEdited ){
if( isEdited === this.options.isEdited )return;
if( !this.options.isEditable )return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册