|
|
@@ -87,43 +87,50 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
|
|
|
}.bind(this));
|
|
|
},
|
|
|
getInputNodes: function(){
|
|
|
- this.inputAreaNode = this.node.getFirst("div");
|
|
|
- this.actionAreaNode = this.inputAreaNode.getNext().setStyles(this.css.actionAreaNode);
|
|
|
- this.listAreaNode = this.actionAreaNode.getNext().getNext();
|
|
|
- this.fieldListAreaNode = this.listAreaNode.getNext().getNext();
|
|
|
- this.restrictViewFilterTable = this.inputAreaNode.getLast("table");
|
|
|
-
|
|
|
- var selects = this.inputAreaNode.getElements("select");
|
|
|
- var inputs = this.inputAreaNode.getElements("input");
|
|
|
+ debugger;
|
|
|
+ this.inputAreaNode = this.node.getElement(".inputAreaNode_vf");
|
|
|
+ this.actionAreaNode = this.node.getElement(".actionAreaNode_vf");
|
|
|
+ this.actionAreaNode.setStyles( this.css.actionAreaNode );
|
|
|
+ this.listAreaNode = this.node.getElement(".listAreaNode_vf");
|
|
|
+ this.fieldListAreaNode = this.node.getElement(".fieldListAreaNode_vf");
|
|
|
+
|
|
|
+ this.restrictViewFilterTable = this.node.getElement(".restrictViewFilterTable_vf");
|
|
|
+
|
|
|
var scriptValueArea = this.node.getElement(".MWFFilterFormulaArea");
|
|
|
if (scriptValueArea){
|
|
|
this.createScriptArea(scriptValueArea);
|
|
|
}
|
|
|
|
|
|
- this.titleInput = inputs[0];
|
|
|
- this.pathInput = inputs[1];
|
|
|
- this.datatypeInput = selects[0];
|
|
|
+ this.titleInput = this.inputAreaNode.getElement(".titleInput_vf");
|
|
|
+ this.pathInput = this.inputAreaNode.getElement(".pathInput_vf");
|
|
|
+ this.datatypeInput = this.inputAreaNode.getElement(".datatypeInput_vf");
|
|
|
|
|
|
- this.restrictFilterInput = inputs[2];
|
|
|
- this.customFilterInput = inputs[3];
|
|
|
+ this.restrictFilterInput = this.inputAreaNode.getElement(".restrictFilterInput_vf");
|
|
|
+ this.customFilterInput = this.inputAreaNode.getElement(".customFilterInput_vf");
|
|
|
|
|
|
- this.logicInput = selects[1];
|
|
|
- this.comparisonInput = selects[2];
|
|
|
- this.valueTextInput = inputs[4];
|
|
|
- this.valueNumberInput = inputs[5];
|
|
|
- this.valueDatetimeInput = inputs[6];
|
|
|
- this.valueBooleanInput = selects[3];
|
|
|
- this.valueDateInput = inputs[7];
|
|
|
- this.valueTimeInput = inputs[8];
|
|
|
+ this.logicInput = this.inputAreaNode.getElement(".logicInput_vf");
|
|
|
|
|
|
- debugger;
|
|
|
- var dataId = this.app.view.data.id;
|
|
|
- this.customFilterValueTypes = this.inputAreaNode.getElements("[name='"+dataId+"viewCustomFilterValueType']");
|
|
|
+ this.comparisonInput = this.inputAreaNode.getElement(".comparisonInput_vf");
|
|
|
+ this.comparisonInput.addEvent("change", function(){
|
|
|
+ this.switchInputDisplay();
|
|
|
+ }.bind(this))
|
|
|
|
|
|
- this.customFilterValueScriptDiv = this.inputAreaNode.getElement("#"+dataId+"viewCustomFilterValueScriptDiv");
|
|
|
- this.customFilterValueScript = this.inputAreaNode.getElement("[name='"+dataId+"viewCustomFilterValueScript']");
|
|
|
- if( this.customFilterValueScript ){
|
|
|
- this.createCustomFilterValueScriptArea(this.customFilterValueScript);
|
|
|
+ this.valueTextInput = this.inputAreaNode.getElement(".valueTextInput_vf");
|
|
|
+ this.valueNumberInput = this.inputAreaNode.getElement(".valueNumberInput_vf");
|
|
|
+ this.valueDatetimeInput = this.inputAreaNode.getElement(".valueDatetimeInput_vf");
|
|
|
+ this.valueBooleanInput = this.inputAreaNode.getElement(".valueBooleanInput_vf");
|
|
|
+ this.valueDateInput = this.inputAreaNode.getElement(".valueDateInput_vf");
|
|
|
+ this.valueTimeInput = this.inputAreaNode.getElement(".valueTimeInput_vf");
|
|
|
+
|
|
|
+ if( this.app.view ){
|
|
|
+ var dataId = this.app.view.data.id;
|
|
|
+ this.customFilterValueTypes = this.inputAreaNode.getElements("[name='"+dataId+"viewCustomFilterValueType']");
|
|
|
+
|
|
|
+ this.customFilterValueScriptDiv = this.inputAreaNode.getElement("#"+dataId+"viewCustomFilterValueScriptDiv");
|
|
|
+ this.customFilterValueScript = this.inputAreaNode.getElement("[name='"+dataId+"viewCustomFilterValueScript']");
|
|
|
+ if( this.customFilterValueScript ){
|
|
|
+ this.createCustomFilterValueScriptArea(this.customFilterValueScript);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
this.datatypeInput.addEvent("change");
|
|
|
@@ -155,7 +162,8 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
|
|
|
}.bind(this));
|
|
|
|
|
|
this.datatypeInput.addEvent("change", function(){
|
|
|
- this.changeValueInput();
|
|
|
+ // this.changeValueInput();
|
|
|
+ this.switchInputDisplay();
|
|
|
}.bind(this));
|
|
|
|
|
|
this.valueTextInput.addEvent("keydown", function(e){
|
|
|
@@ -168,53 +176,251 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
|
|
|
if (this.app.view){
|
|
|
var id = this.app.view.data.id;
|
|
|
var div = this.node.getElement("#"+id+"viewFilterValueArea2");
|
|
|
- inputs = div.getElements("input");
|
|
|
- this.valueTextInput2 = inputs[0] || null;
|
|
|
- this.valueNumberInput2 = inputs[1] || null;
|
|
|
- this.valueDatetimeInput2 = inputs[2] || null;
|
|
|
- this.valueDateInput2 = inputs[3] || null;
|
|
|
- this.valueTimeInput2 = inputs[4] || null;
|
|
|
- this.valueBooleanInput2 = div.getElement("select") || null;
|
|
|
-
|
|
|
- MWF.require("MWF.widget.Calendar", function(){
|
|
|
- this.calendar = new MWF.widget.Calendar(this.valueDatetimeInput2, {
|
|
|
- "style": "xform",
|
|
|
- "isTime": true,
|
|
|
- "secondEnable": true,
|
|
|
- "target": this.app.content,
|
|
|
- "format": "db",
|
|
|
- "onComplate": function(){
|
|
|
- this.node.getElement("#"+id+"viewFilterDateFormulaSelector2").getElements("input").set("checked", false);
|
|
|
- }.bind(this)
|
|
|
- });
|
|
|
- new MWF.widget.Calendar(this.valueDateInput2, {
|
|
|
- "style": "xform",
|
|
|
- "isTime": false,
|
|
|
- "target": this.app.content,
|
|
|
- "format": "%Y-%m-%d"
|
|
|
- });
|
|
|
- new MWF.widget.Calendar(this.valueTimeInput2, {
|
|
|
- "style": "xform",
|
|
|
- "timeOnly": true,
|
|
|
- "secondEnable": true,
|
|
|
- "target": this.app.content,
|
|
|
- "format": "%H:%M:%S"
|
|
|
- });
|
|
|
- }.bind(this));
|
|
|
+ // inputs = div.getElements("input");
|
|
|
+ if( div ){
|
|
|
+ this.valueTextInput2 = div.getElement(".valueTextInput2_vf") || null;
|
|
|
+ this.valueNumberInput2 = div.getElement(".valueNumberInput2_vf") || null;
|
|
|
+ this.valueDatetimeInput2 = div.getElement(".valueDatetimeInput2_vf") || null;
|
|
|
+ this.valueDateInput2 = div.getElement(".valueDateInput2_vf") || null;
|
|
|
+ this.valueTimeInput2 = div.getElement(".valueTimeInput2_vf") || null;
|
|
|
+ this.valueBooleanInput2 = div.getElement(".valueBooleanInput2_vf") || null;
|
|
|
|
|
|
- this.valueTextInput2.addEvent("keydown", function(e){
|
|
|
- if (e.code==13) this.modifyOrAddFilterItem();
|
|
|
- }.bind(this));
|
|
|
- this.valueNumberInput2.addEvent("keydown", function(e){
|
|
|
- if (e.code==13) this.modifyOrAddFilterItem();
|
|
|
- }.bind(this));
|
|
|
+ MWF.require("MWF.widget.Calendar", function(){
|
|
|
+ this.calendar = new MWF.widget.Calendar(this.valueDatetimeInput2, {
|
|
|
+ "style": "xform",
|
|
|
+ "isTime": true,
|
|
|
+ "secondEnable": true,
|
|
|
+ "target": this.app.content,
|
|
|
+ "format": "db",
|
|
|
+ "onComplate": function(){
|
|
|
+ this.node.getElement("#"+id+"viewFilterDateFormulaSelector2").getElements("input").set("checked", false);
|
|
|
+ }.bind(this)
|
|
|
+ });
|
|
|
+ new MWF.widget.Calendar(this.valueDateInput2, {
|
|
|
+ "style": "xform",
|
|
|
+ "isTime": false,
|
|
|
+ "target": this.app.content,
|
|
|
+ "format": "%Y-%m-%d"
|
|
|
+ });
|
|
|
+ new MWF.widget.Calendar(this.valueTimeInput2, {
|
|
|
+ "style": "xform",
|
|
|
+ "timeOnly": true,
|
|
|
+ "secondEnable": true,
|
|
|
+ "target": this.app.content,
|
|
|
+ "format": "%H:%M:%S"
|
|
|
+ });
|
|
|
+ }.bind(this));
|
|
|
+
|
|
|
+ this.valueTextInput2.addEvent("keydown", function(e){
|
|
|
+ if (e.code==13) this.modifyOrAddFilterItem();
|
|
|
+ }.bind(this));
|
|
|
+ this.valueNumberInput2.addEvent("keydown", function(e){
|
|
|
+ if (e.code==13) this.modifyOrAddFilterItem();
|
|
|
+ }.bind(this));
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- changeValueInput: function(){
|
|
|
- var type = this.datatypeInput.options[this.datatypeInput.selectedIndex].value;
|
|
|
- switch (type){
|
|
|
+ switchInputDisplay : function(){
|
|
|
+ var id = "";
|
|
|
+ if( this.app.view ){
|
|
|
+ id = this.app.view.data.id;
|
|
|
+ }
|
|
|
+
|
|
|
+ var config = {
|
|
|
+ "textValue": {
|
|
|
+ "equals": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterTextFormulaSelector"] //["input", "@person", "@unitList", "@unitAllList", "@identityList" ],
|
|
|
+ },
|
|
|
+ "notEquals": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterTextFormulaSelector"] //["input", "@person", "@unitList", "@unitAllList", "@identityList" ],
|
|
|
+ },
|
|
|
+ "greaterThan": {
|
|
|
+ "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
|
|
|
+ },
|
|
|
+ "greaterThanOrEqualTo": {
|
|
|
+ "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
|
|
|
+ },
|
|
|
+ "lessThan": {
|
|
|
+ "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
|
|
|
+ },
|
|
|
+ "lessThanOrEqualTo": {
|
|
|
+ "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
|
|
|
+ },
|
|
|
+ "like": {
|
|
|
+ "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
|
|
|
+ },
|
|
|
+ "notLike": {
|
|
|
+ "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
|
|
|
+ },
|
|
|
+ "range": {
|
|
|
+ "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "numberValue": {
|
|
|
+ "equals": {}, //["input"]
|
|
|
+ "notEquals": {},
|
|
|
+ "greaterThan": {},
|
|
|
+ "greaterThanOrEqualTo": {},
|
|
|
+ "lessThan": {},
|
|
|
+ "lessThanOrEqualTo": {},
|
|
|
+ "range": {}
|
|
|
+ },
|
|
|
+ "dateTimeValue": {
|
|
|
+ "equals": {
|
|
|
+ "invalidValue" : ["@year","@season","@month","@time","@date"]
|
|
|
+ },
|
|
|
+ "notEquals": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"]
|
|
|
+ },
|
|
|
+ "greaterThan": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"]
|
|
|
+ },
|
|
|
+ "greaterThanOrEqualTo": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"]
|
|
|
+ },
|
|
|
+ "lessThan": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"]
|
|
|
+ },
|
|
|
+ "lessThanOrEqualTo": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"]
|
|
|
+ },
|
|
|
+ "range": {
|
|
|
+ "invalidValue" : ["@year","@season","@month","@time","@date"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "dateValue": {
|
|
|
+ "equals": {
|
|
|
+ "invalidValue" : ["@year","@season","@month","@date"]
|
|
|
+ },
|
|
|
+ "notEquals": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"]
|
|
|
+ },
|
|
|
+ "greaterThan":{
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"]
|
|
|
+ },
|
|
|
+ "greaterThanOrEqualTo": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"]
|
|
|
+ },
|
|
|
+ "lessThan": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"]
|
|
|
+ },
|
|
|
+ "lessThanOrEqualTo": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"]
|
|
|
+ },
|
|
|
+ "range": {
|
|
|
+ "invalidValue" : ["@year","@season","@month","@date"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "timeValue": {
|
|
|
+ "equals": {
|
|
|
+ "invalidValue" : ["@time"]
|
|
|
+ },
|
|
|
+ "notEquals": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"]
|
|
|
+ },
|
|
|
+ "greaterThan": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"]
|
|
|
+ },
|
|
|
+ "greaterThanOrEqualTo": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"]
|
|
|
+ },
|
|
|
+ "lessThan": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"]
|
|
|
+ },
|
|
|
+ "lessThanOrEqualTo": {
|
|
|
+ "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"]
|
|
|
+ },
|
|
|
+ "range": {
|
|
|
+ "invalidValue" : ["@time"]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "booleanValue": {
|
|
|
+ "equals": {},
|
|
|
+ "notEquals": {}
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ debugger;
|
|
|
+
|
|
|
+ var formulaSelectorIdList = [
|
|
|
+ "#"+id+"viewFilterTextFormulaSelector",
|
|
|
+ "#"+id+"viewFilterDateFormulaSelector",
|
|
|
+ "#"+id+"viewFilterDateOnlyFormulaSelector",
|
|
|
+ "#"+id+"viewFilterTimeOnlyFormulaSelector"
|
|
|
+ ];
|
|
|
+
|
|
|
+ var formatType = this.datatypeInput.options[this.datatypeInput.selectedIndex].value;
|
|
|
+ var object = config[formatType];
|
|
|
+
|
|
|
+ var availableComparisonList = Object.keys( object );
|
|
|
+ var options = this.comparisonInput.options;
|
|
|
+
|
|
|
+ var comparison = options[this.comparisonInput.selectedIndex].value;
|
|
|
+
|
|
|
+ if( !this.originalComparisonOptions ){
|
|
|
+ this.originalComparisonOptions = [];
|
|
|
+ for( var i=0; i< options.length; i++ ){
|
|
|
+ this.originalComparisonOptions.push({
|
|
|
+ "text" : options[i].text,
|
|
|
+ "value" : options[i].value
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ while( this.comparisonInput.options && this.comparisonInput.options.length ){
|
|
|
+ this.comparisonInput.options[0].destroy();
|
|
|
+ }
|
|
|
+
|
|
|
+ for( var i=0; i<this.originalComparisonOptions.length; i++ ){
|
|
|
+ var opt = this.originalComparisonOptions[i];
|
|
|
+ if( availableComparisonList.contains( opt.value )){
|
|
|
+ var option = new Element("option", {
|
|
|
+ text : opt.text,
|
|
|
+ value : opt.value
|
|
|
+ }).inject( this.comparisonInput );
|
|
|
+ if( opt.value === comparison )option.selected = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var availableInputArray = [];
|
|
|
+ var invalidValue = [];
|
|
|
+ for( var key in object ){
|
|
|
+ if( comparison === key ){
|
|
|
+ availableInputArray = object[key].selectorArea || [];
|
|
|
+ invalidValue = object[key].invalidValue || [];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for( var i=0; i<invalidValue.length; i++ ){
|
|
|
+ invalidValue[i] = invalidValue[i].toLowerCase();
|
|
|
+ }
|
|
|
+
|
|
|
+ formulaSelectorIdList.each( function(id) {
|
|
|
+ var el = this.inputAreaNode.getElement( id );
|
|
|
+ if( !el )return;
|
|
|
+ el.setStyle("display", availableInputArray.contains(id) ? "block" : "none" );
|
|
|
+ }.bind(this));
|
|
|
+
|
|
|
+ var viewFilterValue2Area, viewFilterValueTitleArea;
|
|
|
+ if ( availableComparisonList.contains("range") && comparison=="range"){
|
|
|
+ viewFilterValue2Area = this.inputAreaNode.getElement("#"+id+"viewFilterValue2Area");
|
|
|
+ if(viewFilterValue2Area)viewFilterValue2Area.setStyle('display', 'block');
|
|
|
+
|
|
|
+ viewFilterValueTitleArea = this.inputAreaNode.getElement("#"+id+"viewFilterValueTitleArea");
|
|
|
+ if(viewFilterValueTitleArea)viewFilterValueTitleArea.set('text', '从');
|
|
|
+ }else{
|
|
|
+ viewFilterValue2Area = this.inputAreaNode.getElement("#"+id+"viewFilterValue2Area");
|
|
|
+ if(viewFilterValue2Area)viewFilterValue2Area.setStyle('display', 'none');
|
|
|
+
|
|
|
+ viewFilterValueTitleArea = this.inputAreaNode.getElement("#"+id+"viewFilterValueTitleArea");
|
|
|
+ if(viewFilterValueTitleArea)viewFilterValueTitleArea.set('text', '值');
|
|
|
+ }
|
|
|
+ switch (formatType){
|
|
|
case "textValue":
|
|
|
this.valueTextInput.setStyle("display", "block");
|
|
|
+ if( invalidValue.contains( (this.valueTextInput.get("value") || "" ).toLowerCase() )){
|
|
|
+ this.valueTextInput.set("value","");
|
|
|
+ }
|
|
|
this.valueNumberInput.setStyle("display", "none");
|
|
|
this.valueDatetimeInput.setStyle("display", "none");
|
|
|
this.valueDateInput.setStyle("display", "none");
|
|
|
@@ -230,6 +436,9 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
|
|
|
case "numberValue":
|
|
|
this.valueTextInput.setStyle("display", "none");
|
|
|
this.valueNumberInput.setStyle("display", "block");
|
|
|
+ if( invalidValue.contains( (this.valueNumberInput.get("value") || "" ).toLowerCase() )){
|
|
|
+ this.valueNumberInput.set("value","");
|
|
|
+ }
|
|
|
this.valueDatetimeInput.setStyle("display", "none");
|
|
|
this.valueBooleanInput.setStyle("display", "none");
|
|
|
this.valueDateInput.setStyle("display", "none");
|
|
|
@@ -246,6 +455,9 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
|
|
|
this.valueTextInput.setStyle("display", "none");
|
|
|
this.valueNumberInput.setStyle("display", "none");
|
|
|
this.valueDatetimeInput.setStyle("display", "block");
|
|
|
+ if( invalidValue.contains( (this.valueDatetimeInput.get("value") || "" ).toLowerCase() )){
|
|
|
+ this.valueDatetimeInput.set("value","");
|
|
|
+ }
|
|
|
this.valueBooleanInput.setStyle("display", "none");
|
|
|
this.valueDateInput.setStyle("display", "none");
|
|
|
this.valueTimeInput.setStyle("display", "none");
|
|
|
@@ -262,6 +474,9 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
|
|
|
this.valueDatetimeInput.setStyle("display", "none");
|
|
|
this.valueBooleanInput.setStyle("display", "none");
|
|
|
this.valueDateInput.setStyle("display", "block");
|
|
|
+ if( invalidValue.contains( (this.valueDateInput.get("value") || "" ).toLowerCase() )){
|
|
|
+ this.valueDateInput.set("value","");
|
|
|
+ }
|
|
|
this.valueTimeInput.setStyle("display", "none");
|
|
|
if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
|
|
|
if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
|
|
|
@@ -277,6 +492,9 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
|
|
|
this.valueBooleanInput.setStyle("display", "none");
|
|
|
this.valueDateInput.setStyle("display", "none");
|
|
|
this.valueTimeInput.setStyle("display", "block");
|
|
|
+ if( invalidValue.contains( (this.valueTimeInput.get("value") || "" ).toLowerCase() )){
|
|
|
+ this.valueTimeInput.set("value","");
|
|
|
+ }
|
|
|
if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
|
|
|
if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
|
|
|
if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
|
|
|
@@ -288,6 +506,8 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
|
|
|
this.valueTextInput.setStyle("display", "none");
|
|
|
this.valueNumberInput.setStyle("display", "none");
|
|
|
this.valueDatetimeInput.setStyle("display", "none");
|
|
|
+ this.valueDateInput.setStyle("display", "none");
|
|
|
+ this.valueTimeInput.setStyle("display", "none");
|
|
|
this.valueBooleanInput.setStyle("display", "block");
|
|
|
if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
|
|
|
if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
|
|
|
@@ -298,6 +518,219 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
+ // getInputNodes: function(){
|
|
|
+ // this.inputAreaNode = this.node.getFirst("div");
|
|
|
+ // this.actionAreaNode = this.inputAreaNode.getNext().setStyles(this.css.actionAreaNode);
|
|
|
+ // this.listAreaNode = this.actionAreaNode.getNext().getNext();
|
|
|
+ // this.fieldListAreaNode = this.listAreaNode.getNext().getNext();
|
|
|
+ // this.restrictViewFilterTable = this.inputAreaNode.getLast("table");
|
|
|
+ //
|
|
|
+ // var selects = this.inputAreaNode.getElements("select");
|
|
|
+ // var inputs = this.inputAreaNode.getElements("input");
|
|
|
+ // var scriptValueArea = this.node.getElement(".MWFFilterFormulaArea");
|
|
|
+ // if (scriptValueArea){
|
|
|
+ // this.createScriptArea(scriptValueArea);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // this.titleInput = inputs[0];
|
|
|
+ // this.pathInput = inputs[1];
|
|
|
+ // this.datatypeInput = selects[0];
|
|
|
+ //
|
|
|
+ // this.restrictFilterInput = inputs[2];
|
|
|
+ // this.customFilterInput = inputs[3];
|
|
|
+ //
|
|
|
+ // this.logicInput = selects[1];
|
|
|
+ // this.comparisonInput = selects[2];
|
|
|
+ // this.valueTextInput = inputs[4];
|
|
|
+ // this.valueNumberInput = inputs[5];
|
|
|
+ // this.valueDatetimeInput = inputs[6];
|
|
|
+ // this.valueBooleanInput = selects[3];
|
|
|
+ // this.valueDateInput = inputs[7];
|
|
|
+ // this.valueTimeInput = inputs[8];
|
|
|
+ //
|
|
|
+ // debugger;
|
|
|
+ // var dataId = this.app.view.data.id;
|
|
|
+ // this.customFilterValueTypes = this.inputAreaNode.getElements("[name='"+dataId+"viewCustomFilterValueType']");
|
|
|
+ //
|
|
|
+ // this.customFilterValueScriptDiv = this.inputAreaNode.getElement("#"+dataId+"viewCustomFilterValueScriptDiv");
|
|
|
+ // this.customFilterValueScript = this.inputAreaNode.getElement("[name='"+dataId+"viewCustomFilterValueScript']");
|
|
|
+ // if( this.customFilterValueScript ){
|
|
|
+ // this.createCustomFilterValueScriptArea(this.customFilterValueScript);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // this.datatypeInput.addEvent("change");
|
|
|
+ //
|
|
|
+ // MWF.require("MWF.widget.Calendar", function(){
|
|
|
+ // this.calendar = new MWF.widget.Calendar(this.valueDatetimeInput, {
|
|
|
+ // "style": "xform",
|
|
|
+ // "isTime": true,
|
|
|
+ // "secondEnable": true,
|
|
|
+ // "target": this.app.content,
|
|
|
+ // "format": "db",
|
|
|
+ // "onComplate": function(){
|
|
|
+ // this.node.getElement("#"+id+"viewFilterDateFormulaSelector").getElements("input").set("checked", false);
|
|
|
+ // }.bind(this)
|
|
|
+ // });
|
|
|
+ // new MWF.widget.Calendar(this.valueDateInput, {
|
|
|
+ // "style": "xform",
|
|
|
+ // "isTime": false,
|
|
|
+ // "target": this.app.content,
|
|
|
+ // "format": "%Y-%m-%d"
|
|
|
+ // });
|
|
|
+ // new MWF.widget.Calendar(this.valueTimeInput, {
|
|
|
+ // "style": "xform",
|
|
|
+ // "timeOnly": true,
|
|
|
+ // "secondEnable": true,
|
|
|
+ // "target": this.app.content,
|
|
|
+ // "format": "%H:%M:%S"
|
|
|
+ // });
|
|
|
+ // }.bind(this));
|
|
|
+ //
|
|
|
+ // this.datatypeInput.addEvent("change", function(){
|
|
|
+ // this.changeValueInput();
|
|
|
+ // }.bind(this));
|
|
|
+ //
|
|
|
+ // this.valueTextInput.addEvent("keydown", function(e){
|
|
|
+ // if (e.code==13) this.modifyOrAddFilterItem();
|
|
|
+ // }.bind(this));
|
|
|
+ // this.valueNumberInput.addEvent("keydown", function(e){
|
|
|
+ // if (e.code==13) this.modifyOrAddFilterItem();
|
|
|
+ // }.bind(this));
|
|
|
+ //
|
|
|
+ // if (this.app.view){
|
|
|
+ // var id = this.app.view.data.id;
|
|
|
+ // var div = this.node.getElement("#"+id+"viewFilterValueArea2");
|
|
|
+ // inputs = div.getElements("input");
|
|
|
+ // this.valueTextInput2 = inputs[0] || null;
|
|
|
+ // this.valueNumberInput2 = inputs[1] || null;
|
|
|
+ // this.valueDatetimeInput2 = inputs[2] || null;
|
|
|
+ // this.valueDateInput2 = inputs[3] || null;
|
|
|
+ // this.valueTimeInput2 = inputs[4] || null;
|
|
|
+ // this.valueBooleanInput2 = div.getElement("select") || null;
|
|
|
+ //
|
|
|
+ // MWF.require("MWF.widget.Calendar", function(){
|
|
|
+ // this.calendar = new MWF.widget.Calendar(this.valueDatetimeInput2, {
|
|
|
+ // "style": "xform",
|
|
|
+ // "isTime": true,
|
|
|
+ // "secondEnable": true,
|
|
|
+ // "target": this.app.content,
|
|
|
+ // "format": "db",
|
|
|
+ // "onComplate": function(){
|
|
|
+ // this.node.getElement("#"+id+"viewFilterDateFormulaSelector2").getElements("input").set("checked", false);
|
|
|
+ // }.bind(this)
|
|
|
+ // });
|
|
|
+ // new MWF.widget.Calendar(this.valueDateInput2, {
|
|
|
+ // "style": "xform",
|
|
|
+ // "isTime": false,
|
|
|
+ // "target": this.app.content,
|
|
|
+ // "format": "%Y-%m-%d"
|
|
|
+ // });
|
|
|
+ // new MWF.widget.Calendar(this.valueTimeInput2, {
|
|
|
+ // "style": "xform",
|
|
|
+ // "timeOnly": true,
|
|
|
+ // "secondEnable": true,
|
|
|
+ // "target": this.app.content,
|
|
|
+ // "format": "%H:%M:%S"
|
|
|
+ // });
|
|
|
+ // }.bind(this));
|
|
|
+ //
|
|
|
+ // this.valueTextInput2.addEvent("keydown", function(e){
|
|
|
+ // if (e.code==13) this.modifyOrAddFilterItem();
|
|
|
+ // }.bind(this));
|
|
|
+ // this.valueNumberInput2.addEvent("keydown", function(e){
|
|
|
+ // if (e.code==13) this.modifyOrAddFilterItem();
|
|
|
+ // }.bind(this));
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // changeValueInput: function(){
|
|
|
+ // var type = this.datatypeInput.options[this.datatypeInput.selectedIndex].value;
|
|
|
+ // switch (type){
|
|
|
+ // case "textValue":
|
|
|
+ // this.valueTextInput.setStyle("display", "block");
|
|
|
+ // this.valueNumberInput.setStyle("display", "none");
|
|
|
+ // this.valueDatetimeInput.setStyle("display", "none");
|
|
|
+ // this.valueDateInput.setStyle("display", "none");
|
|
|
+ // this.valueTimeInput.setStyle("display", "none");
|
|
|
+ // this.valueBooleanInput.setStyle("display", "none");
|
|
|
+ // if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "block");
|
|
|
+ // if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
|
|
|
+ // break;
|
|
|
+ // case "numberValue":
|
|
|
+ // this.valueTextInput.setStyle("display", "none");
|
|
|
+ // this.valueNumberInput.setStyle("display", "block");
|
|
|
+ // this.valueDatetimeInput.setStyle("display", "none");
|
|
|
+ // this.valueBooleanInput.setStyle("display", "none");
|
|
|
+ // this.valueDateInput.setStyle("display", "none");
|
|
|
+ // this.valueTimeInput.setStyle("display", "none");
|
|
|
+ // if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "block");
|
|
|
+ // if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
|
|
|
+ // break;
|
|
|
+ // case "datetimeValue":
|
|
|
+ // case "dateTimeValue":
|
|
|
+ // this.valueTextInput.setStyle("display", "none");
|
|
|
+ // this.valueNumberInput.setStyle("display", "none");
|
|
|
+ // this.valueDatetimeInput.setStyle("display", "block");
|
|
|
+ // this.valueBooleanInput.setStyle("display", "none");
|
|
|
+ // this.valueDateInput.setStyle("display", "none");
|
|
|
+ // this.valueTimeInput.setStyle("display", "none");
|
|
|
+ // if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "block");
|
|
|
+ // if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
|
|
|
+ // break;
|
|
|
+ // case "dateValue":
|
|
|
+ // this.valueTextInput.setStyle("display", "none");
|
|
|
+ // this.valueNumberInput.setStyle("display", "none");
|
|
|
+ // this.valueDatetimeInput.setStyle("display", "none");
|
|
|
+ // this.valueBooleanInput.setStyle("display", "none");
|
|
|
+ // this.valueDateInput.setStyle("display", "block");
|
|
|
+ // this.valueTimeInput.setStyle("display", "none");
|
|
|
+ // if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "block");
|
|
|
+ // if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
|
|
|
+ // break;
|
|
|
+ // case "timeValue":
|
|
|
+ // this.valueTextInput.setStyle("display", "none");
|
|
|
+ // this.valueNumberInput.setStyle("display", "none");
|
|
|
+ // this.valueDatetimeInput.setStyle("display", "none");
|
|
|
+ // this.valueBooleanInput.setStyle("display", "none");
|
|
|
+ // this.valueDateInput.setStyle("display", "none");
|
|
|
+ // this.valueTimeInput.setStyle("display", "block");
|
|
|
+ // if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "block");
|
|
|
+ // if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
|
|
|
+ // break;
|
|
|
+ // case "booleanValue":
|
|
|
+ // this.valueTextInput.setStyle("display", "none");
|
|
|
+ // this.valueNumberInput.setStyle("display", "none");
|
|
|
+ // this.valueDatetimeInput.setStyle("display", "none");
|
|
|
+ // this.valueTimeInput.setStyle("display", "none");
|
|
|
+ // this.valueBooleanInput.setStyle("display", "block");
|
|
|
+ // if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
|
|
|
+ // if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "block");
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
createActionNode: function(){
|
|
|
this.actionNode = new Element("div", {"styles": this.css.actionNode}).inject(this.actionAreaNode);
|
|
|
this.actionNode.addEvent("click", function(){
|
|
|
@@ -612,7 +1045,7 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
|
|
|
}
|
|
|
|
|
|
|
|
|
- this.changeValueInput();
|
|
|
+ this.switchInputDisplay();
|
|
|
if(this.datatypeInput.onchange){
|
|
|
this.datatypeInput.onchange();
|
|
|
}
|