|
|
@@ -405,11 +405,13 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
|
|
|
}, null, null, this.form.json.confirmStyle);
|
|
|
|
|
|
},
|
|
|
- _completeLineEdit: function(){
|
|
|
+ _completeLineEdit: function( ev, ignoreValidation ){
|
|
|
//this.currentEditLine.getElemets(td);
|
|
|
- if (!this.editValidation()){
|
|
|
- return false;
|
|
|
- }
|
|
|
+ if( !ignoreValidation ){
|
|
|
+ if (!this.editValidation()){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
this.isEdit = false;
|
|
|
|
|
|
@@ -938,14 +940,15 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
|
|
|
this.setData(this._getValue());
|
|
|
},
|
|
|
setData: function(data){
|
|
|
- if (data){
|
|
|
+ // if( typeOf( data ) === "object" && typeOf(data.data) === "array" ){
|
|
|
+ if (data){
|
|
|
this._setBusinessData(data);
|
|
|
this.gridData = data;
|
|
|
}else{
|
|
|
this.gridData = this._getValue();
|
|
|
}
|
|
|
|
|
|
- if (this.isEdit) this._completeLineEdit();
|
|
|
+ if (this.isEdit) this._completeLineEdit( null,true );
|
|
|
if (this.gridData){
|
|
|
var trs = this.table.getElements("tr");
|
|
|
for (var i=1; i<trs.length-1; i++){
|
|
|
@@ -984,6 +987,15 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
|
|
|
this._loadTotal();
|
|
|
return this.totalResaults;
|
|
|
},
|
|
|
+ isEmpty: function(){
|
|
|
+ var data = this.getData();
|
|
|
+ if( !data )return true;
|
|
|
+ if( typeOf( data ) === "object" ){
|
|
|
+ if( typeOf( data.data ) !== "array" )return true;
|
|
|
+ if( data.data.length === 0 )return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
getData: function(){
|
|
|
if (this.editable!=false){
|
|
|
if (this.isEdit) this._completeLineEdit();
|