diff -r fa742816bb8b -r 259c97782bf8 www/jqwidgets/jqxpivotdesigner.js --- a/www/jqwidgets/jqxpivotdesigner.js Wed Aug 21 17:26:56 2019 +0200 +++ b/www/jqwidgets/jqxpivotdesigner.js Thu Aug 22 14:10:58 2019 +0200 @@ -1,9 +1,9 @@ /* -jQWidgets v7.2.0 (2019-Apr) +jQWidgets v8.1.4 (2019-July) Copyright (c) 2011-2019 jQWidgets. License: https://jqwidgets.com/license/ */ /* eslint-disable */ -(function($){$.jqx.jqxWidget("jqxPivotDesigner","",{});$.extend($.jqx._jqxPivotDesigner.prototype,{defineInstance:function(){var _defaultSettings={type:"pivotGrid",target:null,dataFields:null};$.extend(true,this,_defaultSettings);return _defaultSettings},_instanceId:0,createInstance:function(args){var element=this.element;var host=this.host;var self=this;if(this.target&&this.target.getInstance){this.target=this.target.getInstance()}var dependencies=[{widget:"jqxWindow",src:"jqxwindow.js"},{widget:"jqxButton",src:"jqxbuttons.js"},{widget:"jqxCheckBox",src:"jqxcheckbox.js"},{widget:"jqxInput",src:"jqxinput.js"},{widget:"jqxScrollBar",src:"jqxscrollbar.js"},{widget:"jqxListBox",src:"jqxlistbox.js"},{widget:"jqxDropDownList",src:"jqxdropdownlist.js"},{widget:"jqxDragDrop",src:"jqxdragdrop.js"}];for(var i in dependencies){if(!window[dependencies[i].widget]){throw new Error("Please include "+dependencies[i].src)}}var touchClass="";if(this._isTouchDevice()){touchClass="class='jqx-grid-menu-item-touch'"}var hostClass="jqx-rc-all jqx-widget jqx-pivotgrid jqx-designer-host"+this.toThemeProperty("jqx-widget-content");host.append("
Pivot Table Fields
Filters
Columns
Rows
Values
");this._listBoxes={fields:self.host.find(".divFields"),rows:self.host.find(".divRows"),columns:self.host.find(".divColumns"),values:self.host.find(".divValues"),filters:self.host.find(".divFilters")};$.jqx.utilities.resize(self.host,function(){self._resize()},false)},destroy:function(){$.jqx.utilities.resize(this.host,null,true);if(self.target){delete self.target._pivotDesigner}},_getLocalizedString:function(str){var localizedStrings=this.target?this.target._localizedStrings:{};switch(str){case"fields":return localizedStrings.fieldslabel||"Pivot Fields";break;case"calculation":return localizedStrings.calculation||"Calculation";break;case"filters":return localizedStrings.filterslabel||"Filters";break;case"rows":return localizedStrings.rowslabel||"Rows";break;case"columns":return localizedStrings.columnslabel||"Columns";break;case"values":return localizedStrings.valueslabel||"Values";break;case"of":return localizedStrings.of||"of";break;case"to":return localizedStrings.to||"to";break;case"move":return localizedStrings.move||"Move";break;case"remove":return localizedStrings.remove||"Remove";break;case"count":return localizedStrings.count||"Count";break;case"sum":return localizedStrings.sum||"Sum";break;case"average":return localizedStrings.avgerage||"Average";break;case"product":return localizedStrings.product||"Product";break;case"min":return localizedStrings.min||"Min";break;case"max":return localizedStrings.max||"Max";break}if(localizedStrings[str]){return localizedStrings[str]}return str},_isTouchDevice:function(){if(this.touchDevice!=undefined){return this.touchDevice}var isTouchDevice=$.jqx.mobile.isTouchDevice();this.touchDevice=isTouchDevice;if(this.touchmode==true){if($.jqx.browser.msie&&$.jqx.browser.version<9){this.enablehover=false;return false}isTouchDevice=true;$.jqx.mobile.setMobileSimulator(this.element);this.touchDevice=isTouchDevice}else{if(this.touchmode==false){isTouchDevice=false}}if(isTouchDevice&&this.touchModeStyle!=false){this.touchDevice=true;this.host.addClass(this.toThemeProperty("jqx-touch"));this.host.find("jqx-widget-content").addClass(this.toThemeProperty("jqx-touch"));this.host.find("jqx-widget-header").addClass(this.toThemeProperty("jqx-touch"));this.scrollbarsize=this.touchscrollbarsize}return isTouchDevice},_resize:function(){var self=this;var lb=self._listBoxes;var padding=5;var host=this.host;var height=host.height()-2*padding;var width=host.width()-2*padding;var measureElement=$("");this.host.append(measureElement);var textH=0;var labelStrings=["fields","filters","rows","columns","values"];for(var i=0;itextH){textH=h}}measureElement.remove();var position=this.host.position();var x=position.left+padding,y=position.top+padding;y+=padding;var labelFields=host.find(".labelFields");labelFields.css({left:x,top:y,width:width-10,height:textH});y+=textH;var boxHeight=(height-3*(textH+2*padding))/3;var boxWidth=(width-padding)/2;lb.fields.css({left:x,top:y,background:"white"});lb.fields.jqxListBox({width:width,height:boxHeight,allowDrop:true,allowDrag:true});y+=boxHeight+2*padding;var labelFilters=host.find(".labelFilters");labelFilters.css({left:x,top:y,width:boxWidth,height:textH});var labelColumns=host.find(".labelColumns");labelColumns.css({left:x+boxWidth+padding,top:y,width:boxWidth,height:textH});y+=textH;lb.filters.css({left:x,top:y});lb.filters.jqxListBox({width:boxWidth,height:boxHeight});lb.columns.css({left:x+boxWidth+padding,top:y});lb.columns.jqxListBox({width:boxWidth,height:boxHeight});y+=boxHeight+2*padding;var labelRows=host.find(".labelRows");labelRows.css({left:x,top:y,width:boxWidth,height:textH});var labelValues=host.find(".labelValues");labelValues.css({left:x+boxWidth+padding,top:y,width:boxWidth,height:textH});y+=textH;host.find(".divRows").css({left:x,top:y});host.find(".divRows").jqxListBox({width:boxWidth,height:boxHeight});host.find(".divValues").css({left:x+boxWidth+padding,top:y});host.find(".divValues").jqxListBox({width:boxWidth,height:boxHeight})},_setupListBoxes:function(){var self=this;var host=self.host;var lb=self._listBoxes;for(var i in lb){var listBox=lb[i];listBox.off();listBox.jqxListBox({allowDrag:true,allowDrop:true,renderer:function(index,label,value){return self._getCustomRendererElement(label,self._listBoxes.fields[0]!=this.host[0])}}).on("dragStart",function(args){lb.rows.jqxListBox({dropAction:"copy"});lb.columns.jqxListBox({dropAction:"copy"});lb.filters.jqxListBox({dropAction:"copy"});lb.values.jqxListBox({dropAction:"copy"});lb.fields.jqxListBox({dropAction:"copy"})}).on("dragEnd",function(event){self._moveElement($(this),event.args.dropTargetElement,event.args.index,event.args.value)})}},_moveElement:function(source,targetElement,elementIndex,elementValue){var self=this;var lb=self._listBoxes;if(targetElement){if(source[0]!=lb.fields[0]){source.jqxListBox("removeAt",elementIndex)}if(targetElement==lb.fields[0]){lb.fields.jqxListBox("clear");self._populateListBox(lb.fields,self._allFields,"all")}else{if(source[0]!=lb.fields[0]||targetElement!=lb.values[0]){if(lb.rows[0]!=targetElement){self._removeItem(lb.rows,elementValue)}if(lb.columns[0]!=targetElement){self._removeItem(lb.columns,elementValue)}}if(targetElement==lb.values[0]){var items=lb.values.jqxListBox("getItems");for(var i=0;i0&&itemMenuButton[0]==this){self._showDesignerItemContextMenu(i,j);return}}}})},_showDesignerItemContextMenu:function(type,itemIndex){var self=this;if(self._isWindowOpen()){return}var lb=self._listBoxes;var fieldSettings={moveOperations:{}};for(var i in lb){if(i==type){continue}fieldSettings.moveOperations[self._getLocalizedString("move")+" "+self._getLocalizedString("to")+" "+self._getLocalizedString(i)]={dropTarget:i}}if(type=="values"){var availableFunctions=self.target.source.getFunctions();var funcItems={};for(var i in availableFunctions){funcItems[self._getLocalizedString(i)]={"function":i}}fieldSettings.functions=funcItems}self._windowData={type:type,itemIndex:itemIndex,fieldSettings:fieldSettings};if(type=="filters"){if(!this._filtersWindow){this._createFiltersWindow()}this._filtersWindow.jqxWindow("open");this._updateFiltersWindowData()}else{if(!this._settingsWindow){this._createSettingsWindow()}this._settingsWindow.jqxWindow("open");this._updateWindowData()}},_isWindowOpen:function(){return(this._settingsWindow&&this._settingsWindow.jqxWindow("isOpen"))||(this._filtersWindow&&this._filtersWindow.jqxWindow("isOpen"))},_getFieldLabel:function(fn,dataField){if(fn){return this._getValueFieldLabel(fn,dataField)}var initSettings=this._targetInitSettings;for(var i in initSettings){if(i=="values"){continue}var fieldList=initSettings[i];for(var j in fieldList){if(fieldList[j].dataField==dataField&&fieldList[j].text){return fieldList[j].text}}}return dataField},_getValueFieldLabel:function(fn,dataField){var self=this;var fnName=self._getLocalizedString(fn)||fn;var matchedText=undefined;var initSettings=self._targetInitSettings;if(initSettings.values){for(var k in initSettings.values){if(initSettings.values[k].dataField==dataField&&initSettings.values[k]["function"]==fn){matchedText=initSettings.values[k].text;if(matchedText!=undefined){break}}}}return matchedText||fnName+" "+self._getLocalizedString("of")+" "+dataField},_removeItem:function(lb,itemValue){var items=lb.jqxListBox("getItems");var removedCount=0;for(var i=0;i
"+label+"
"}return"
"+label+"
"},_readPivotSettings:function(){var self=this;if(!self.target){return}var pivotSource=self.target.source;if(!pivotSource){return}var dataAdapter=pivotSource.dataAdapter;if(!dataAdapter){return}var adapterSettings=dataAdapter._source;if(!adapterSettings){return}self._targetCurrentSettings=$.extend({},self.target.source._initSettings);self._targetInitSettings=$.extend({},self.target.source._initSettings);var allFields={};var fieldSource={dataFields:this.dataFields,adapterDataFields:adapterSettings.datafields,rows:self.target.source.rows,columns:self.target.source.columns,values:self.target.source.values,filters:self.target.source.filters};function addFields(fields,target,fieldType){if(!Array.isArray(fields)){return}for(var i=0;i
"+self._getLocalizedString("alignment")+"
"+self._getLocalizedString("calculation")+"
"+self._getLocalizedString("numberformat")+""+self._getLocalizedString("cellalignment")+"
"+self._getLocalizedString("prefix")+""+self._getLocalizedString("decimalplacestext")+""+self._getLocalizedString("thousandsseparatortext")+""+self._getLocalizedString("decimalseparatortext")+""+self._getLocalizedString("nagativebracketstext")+"
";self.host.append(windowElement);var width=380;var height=360;self._settingsWindow=self.host.find("#pivotFieldSettingsWindow").jqxWindow({title:self._getLocalizedString("fieldsettings"),position:{x:0,y:0},showCollapseButton:true,autoOpen:false,minWidth:width,maxWidth:width,width:width,height:height,initContent:function(){self._updateWindowData();var btnCancel=self._settingsWindow.find(".btnCancel").jqxButton({width:80});var btnOk=self._settingsWindow.find(".btnOk").jqxButton({width:80});btnCancel.on("click",function(){self._settingsWindow.jqxWindow("close")});btnOk.on("click",function(){self._applySettingsWindowChanges();self._settingsWindow.jqxWindow("close")})}})},_applySettingsWindowChanges:function(){var self=this;var itemIndex=self._windowData.itemIndex;var itemType=self._windowData.type;var source=self._listBoxes[itemType];var item=source.jqxListBox("getItem",itemIndex);var lbMoveTo=self._settingsWindow.find(".lbPivotFieldMoveTo");var selectedIndex=lbMoveTo.jqxDropDownList("selectedIndex");if(selectedIndex!=-1){var targetType=undefined;for(var i in self._windowData.fieldSettings.moveOperations){targetType=self._windowData.fieldSettings.moveOperations[i].dropTarget;if(--selectedIndex==-1){break}}var target=self._listBoxes[targetType];var value=item.value;if(target!=self._listBoxes.fields){target.jqxListBox("addItem",{label:item.label,value:value})}self._moveElement(source,target[0],itemIndex,value);return}var lbAlignment=self._settingsWindow.find(".lbAlignment");var selectedItem=lbAlignment.jqxDropDownList("getSelectedItem");self._targetCurrentSettings[itemType][itemIndex].align=selectedItem.value;delete self._targetCurrentSettings[itemType][itemIndex]["function"];if(itemType=="values"){var lbCalculation=self._settingsWindow.find(".lbCalculation");var selectedItem=lbCalculation.jqxDropDownList("getSelectedItem");self._targetCurrentSettings[itemType][itemIndex].text=item.value.text=item.label=self._getFieldLabel(selectedItem.value,item.value.dataField);self._targetCurrentSettings[itemType][itemIndex]["function"]=item.value["function"]=selectedItem.value;source.jqxListBox("updateAt",{label:item.value.text,value:item.value},itemIndex);self._updateListBoxLabels()}if(itemType=="values"){var lbCellsAlignment=self._settingsWindow.find(".lbCellsAlignment");var selectedItem=lbCellsAlignment.jqxDropDownList("getSelectedItem");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.align=selectedItem.value;self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}if(itemType=="values"){var txtPrefix=self._settingsWindow.find(".txtPrefix");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.prefix=txtPrefix.val();self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}if(itemType=="values"){var txtDecimalPlaces=self._settingsWindow.find(".txtDecimalPlaces");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.decimalPlaces=txtDecimalPlaces.val();self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}if(itemType=="values"){var txtThousandsSeparator=self._settingsWindow.find(".txtThousandsSeparator");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.thousandsSeparator=txtThousandsSeparator.val();self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}if(itemType=="values"){var txtDecimalSeparator=self._settingsWindow.find(".txtDecimalSeparator");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.decimalSeparator=txtDecimalSeparator.val();self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}if(itemType=="values"){var checkBoxNagativeWithBrackets=self._settingsWindow.find(".checkBoxNagativeWithBrackets");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.negativeWithBrackets=checkBoxNagativeWithBrackets.val();self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}self._refreshPivotGrid(self._targetCurrentSettings)},_updateWindowData:function(){var self=this;var fieldSettings=self._windowData.fieldSettings;var itemValue=self._listBoxes[self._windowData.type].jqxListBox("getItem",self._windowData.itemIndex).value;var sourceBoundItems=self.target.source[self._windowData.type];var sourceBoundItem=undefined;for(var i=0;i
";self.host.append(windowElement);var width=300;var height=360;self._filtersWindow=self.host.find("#pivotFieldFiltersWindow").jqxWindow({title:self._getLocalizedString("fieldsettings"),position:{x:0,y:0},showCollapseButton:true,autoOpen:false,minWidth:width,maxWidth:width,width:width,height:height,initContent:function(){self._updateFiltersWindowData();var btnCancel=self._filtersWindow.find(".btnCancel").jqxButton({width:80});var btnOk=self._filtersWindow.find(".btnOk").jqxButton({width:80});btnCancel.on("click",function(){self._filtersWindow.jqxWindow("close")});btnOk.on("click",function(){self._applyFiltersWindowChanges();self._filtersWindow.jqxWindow("close")})}})},_updateFiltersWindowData:function(){var self=this;var fieldSettings=self._windowData.fieldSettings;var itemValue=self._listBoxes[self._windowData.type].jqxListBox("getItem",self._windowData.itemIndex).value;var sourceBoundItems=self.target.source[self._windowData.type];var sourceBoundItem=undefined;for(var i=0;i
Pivot Table Fields
Filters
Columns
Rows
Values
");this._listBoxes={fields:self.host.find(".divFields"),rows:self.host.find(".divRows"),columns:self.host.find(".divColumns"),values:self.host.find(".divValues"),filters:self.host.find(".divFilters")};$.jqx.utilities.resize(self.host,function(){self._resize()},false)},destroy:function(){var self=this;$.jqx.utilities.resize(this.host,null,true);if(self.target){delete self.target._pivotDesigner}},_getLocalizedString:function(str){var localizedStrings=this.target?this.target._localizedStrings:{};switch(str){case"fields":return localizedStrings.fieldslabel||"Pivot Fields";break;case"calculation":return localizedStrings.calculation||"Calculation";break;case"filters":return localizedStrings.filterslabel||"Filters";break;case"rows":return localizedStrings.rowslabel||"Rows";break;case"columns":return localizedStrings.columnslabel||"Columns";break;case"values":return localizedStrings.valueslabel||"Values";break;case"of":return localizedStrings.of||"of";break;case"to":return localizedStrings.to||"to";break;case"move":return localizedStrings.move||"Move";break;case"remove":return localizedStrings.remove||"Remove";break;case"count":return localizedStrings.count||"Count";break;case"sum":return localizedStrings.sum||"Sum";break;case"average":return localizedStrings.avgerage||"Average";break;case"product":return localizedStrings.product||"Product";break;case"min":return localizedStrings.min||"Min";break;case"max":return localizedStrings.max||"Max";break}if(localizedStrings[str]){return localizedStrings[str]}return str},_isTouchDevice:function(){if(this.touchDevice!=undefined){return this.touchDevice}var isTouchDevice=$.jqx.mobile.isTouchDevice();this.touchDevice=isTouchDevice;if(this.touchmode==true){if($.jqx.browser.msie&&$.jqx.browser.version<9){this.enablehover=false;return false}isTouchDevice=true;$.jqx.mobile.setMobileSimulator(this.element);this.touchDevice=isTouchDevice}else{if(this.touchmode==false){isTouchDevice=false}}if(isTouchDevice&&this.touchModeStyle!=false){this.touchDevice=true;this.host.addClass(this.toThemeProperty("jqx-touch"));this.host.find("jqx-widget-content").addClass(this.toThemeProperty("jqx-touch"));this.host.find("jqx-widget-header").addClass(this.toThemeProperty("jqx-touch"));this.scrollbarsize=this.touchscrollbarsize}return isTouchDevice},_resize:function(){var self=this;var lb=self._listBoxes;var padding=5;var host=this.host;var height=host.height()-2*padding;var width=host.width()-2*padding;var measureElement=$("");this.host.append(measureElement);var textH=0;var labelStrings=["fields","filters","rows","columns","values"];for(var i=0;itextH){textH=h}}measureElement.remove();var position=this.host.position();var x=position.left+padding,y=position.top+padding;y+=padding;var labelFields=host.find(".labelFields");labelFields.css({left:x,top:y,width:width-10,height:textH});y+=textH;var boxHeight=(height-3*(textH+2*padding))/3;var boxWidth=(width-padding)/2;lb.fields.css({left:x,top:y,background:"white"});lb.fields.jqxListBox({width:width,height:boxHeight,allowDrop:true,allowDrag:true});y+=boxHeight+2*padding;var labelFilters=host.find(".labelFilters");labelFilters.css({left:x,top:y,width:boxWidth,height:textH});var labelColumns=host.find(".labelColumns");labelColumns.css({left:x+boxWidth+padding,top:y,width:boxWidth,height:textH});y+=textH;lb.filters.css({left:x,top:y});lb.filters.jqxListBox({width:boxWidth,height:boxHeight});lb.columns.css({left:x+boxWidth+padding,top:y});lb.columns.jqxListBox({width:boxWidth,height:boxHeight});y+=boxHeight+2*padding;var labelRows=host.find(".labelRows");labelRows.css({left:x,top:y,width:boxWidth,height:textH});var labelValues=host.find(".labelValues");labelValues.css({left:x+boxWidth+padding,top:y,width:boxWidth,height:textH});y+=textH;host.find(".divRows").css({left:x,top:y});host.find(".divRows").jqxListBox({width:boxWidth,height:boxHeight});host.find(".divValues").css({left:x+boxWidth+padding,top:y});host.find(".divValues").jqxListBox({width:boxWidth,height:boxHeight})},_setupListBoxes:function(){var self=this;var host=self.host;var lb=self._listBoxes;for(var i in lb){var listBox=lb[i];listBox.off();listBox.jqxListBox({allowDrag:true,allowDrop:true,renderer:function(index,label,value){return self._getCustomRendererElement(label,self._listBoxes.fields[0]!=this.host[0])}}).on("dragStart",function(args){lb.rows.jqxListBox({dropAction:"copy"});lb.columns.jqxListBox({dropAction:"copy"});lb.filters.jqxListBox({dropAction:"copy"});lb.values.jqxListBox({dropAction:"copy"});lb.fields.jqxListBox({dropAction:"copy"})}).on("dragEnd",function(event){self._moveElement($(this),event.args.dropTargetElement,event.args.index,event.args.value)})}},_moveElement:function(source,targetElement,elementIndex,elementValue){var self=this;var lb=self._listBoxes;if(targetElement){if(source[0]!=lb.fields[0]){source.jqxListBox("removeAt",elementIndex)}if(targetElement==lb.fields[0]){lb.fields.jqxListBox("clear");self._populateListBox(lb.fields,self._allFields,"all")}else{if(source[0]!=lb.fields[0]||targetElement!=lb.values[0]){if(lb.rows[0]!=targetElement){self._removeItem(lb.rows,elementValue)}if(lb.columns[0]!=targetElement){self._removeItem(lb.columns,elementValue)}}if(targetElement==lb.values[0]){var items=lb.values.jqxListBox("getItems");for(var i=0;i0&&itemMenuButton[0]==this){self._showDesignerItemContextMenu(i,j);return}}}})},_showDesignerItemContextMenu:function(type,itemIndex){var self=this;if(self._isWindowOpen()){return}var lb=self._listBoxes;var fieldSettings={moveOperations:{}};for(var i in lb){if(i==type){continue}fieldSettings.moveOperations[self._getLocalizedString("move")+" "+self._getLocalizedString("to")+" "+self._getLocalizedString(i)]={dropTarget:i}}if(type=="values"){var availableFunctions=self.target.source.getFunctions();var funcItems={};for(var i in availableFunctions){funcItems[self._getLocalizedString(i)]={"function":i}}fieldSettings.functions=funcItems}self._windowData={type:type,itemIndex:itemIndex,fieldSettings:fieldSettings};if(type=="filters"){if(!this._filtersWindow){this._createFiltersWindow()}this._filtersWindow.jqxWindow("open");this._updateFiltersWindowData()}else{if(!this._settingsWindow){this._createSettingsWindow()}this._settingsWindow.jqxWindow("open");this._updateWindowData()}},_isWindowOpen:function(){return(this._settingsWindow&&this._settingsWindow.jqxWindow("isOpen"))||(this._filtersWindow&&this._filtersWindow.jqxWindow("isOpen"))},_getFieldLabel:function(fn,dataField){if(fn){return this._getValueFieldLabel(fn,dataField)}var initSettings=this._targetInitSettings;for(var i in initSettings){if(i=="values"){continue}var fieldList=initSettings[i];for(var j in fieldList){if(fieldList[j].dataField==dataField&&fieldList[j].text){return fieldList[j].text}}}return dataField},_getValueFieldLabel:function(fn,dataField){var self=this;var fnName=self._getLocalizedString(fn)||fn;var matchedText=undefined;var initSettings=self._targetInitSettings;if(initSettings.values){for(var k in initSettings.values){if(initSettings.values[k].dataField==dataField&&initSettings.values[k]["function"]==fn){matchedText=initSettings.values[k].text;if(matchedText!=undefined){break}}}}return matchedText||fnName+" "+self._getLocalizedString("of")+" "+dataField},_removeItem:function(lb,itemValue){var items=lb.jqxListBox("getItems");var removedCount=0;for(var i=0;i
"+label+"
"}return"
"+label+"
"},_readPivotSettings:function(){var self=this;if(!self.target){return}var pivotSource=self.target.source;if(!pivotSource){return}var dataAdapter=pivotSource.dataAdapter;if(!dataAdapter){return}var adapterSettings=dataAdapter._source;if(!adapterSettings){return}self._targetCurrentSettings=$.extend({},self.target.source._initSettings);self._targetInitSettings=$.extend({},self.target.source._initSettings);var allFields={};var fieldSource={dataFields:this.dataFields,adapterDataFields:adapterSettings.datafields,rows:self.target.source.rows,columns:self.target.source.columns,values:self.target.source.values,filters:self.target.source.filters};function addFields(fields,target,fieldType){if(!Array.isArray(fields)){return}for(var i=0;i
"+self._getLocalizedString("alignment")+"
"+self._getLocalizedString("calculation")+"
"+self._getLocalizedString("numberformat")+""+self._getLocalizedString("cellalignment")+"
"+self._getLocalizedString("prefix")+""+self._getLocalizedString("decimalplacestext")+""+self._getLocalizedString("thousandsseparatortext")+""+self._getLocalizedString("decimalseparatortext")+""+self._getLocalizedString("nagativebracketstext")+"
";self.host.append(windowElement);var width=380;var height=360;self._settingsWindow=self.host.find("#pivotFieldSettingsWindow").jqxWindow({title:self._getLocalizedString("fieldsettings"),position:{x:0,y:0},showCollapseButton:true,autoOpen:false,minWidth:width,maxWidth:width,width:width,height:height,initContent:function(){self._updateWindowData();var btnCancel=self._settingsWindow.find(".btnCancel").jqxButton({width:80});var btnOk=self._settingsWindow.find(".btnOk").jqxButton({width:80});btnCancel.on("click",function(){self._settingsWindow.jqxWindow("close")});btnOk.on("click",function(){self._applySettingsWindowChanges();self._settingsWindow.jqxWindow("close")})}})},_applySettingsWindowChanges:function(){var self=this;var itemIndex=self._windowData.itemIndex;var itemType=self._windowData.type;var source=self._listBoxes[itemType];var item=source.jqxListBox("getItem",itemIndex);var lbMoveTo=self._settingsWindow.find(".lbPivotFieldMoveTo");var selectedIndex=lbMoveTo.jqxDropDownList("selectedIndex");if(selectedIndex!=-1){var targetType=undefined;for(var i in self._windowData.fieldSettings.moveOperations){targetType=self._windowData.fieldSettings.moveOperations[i].dropTarget;if(--selectedIndex==-1){break}}var target=self._listBoxes[targetType];var value=item.value;if(target!=self._listBoxes.fields){target.jqxListBox("addItem",{label:item.label,value:value})}self._moveElement(source,target[0],itemIndex,value);return}var lbAlignment=self._settingsWindow.find(".lbAlignment");var selectedItem=lbAlignment.jqxDropDownList("getSelectedItem");self._targetCurrentSettings[itemType][itemIndex].align=selectedItem.value;delete self._targetCurrentSettings[itemType][itemIndex]["function"];if(itemType=="values"){var lbCalculation=self._settingsWindow.find(".lbCalculation");var selectedItem=lbCalculation.jqxDropDownList("getSelectedItem");self._targetCurrentSettings[itemType][itemIndex].text=item.value.text=item.label=self._getFieldLabel(selectedItem.value,item.value.dataField);self._targetCurrentSettings[itemType][itemIndex]["function"]=item.value["function"]=selectedItem.value;source.jqxListBox("updateAt",{label:item.value.text,value:item.value},itemIndex);self._updateListBoxLabels()}if(itemType=="values"){var lbCellsAlignment=self._settingsWindow.find(".lbCellsAlignment");var selectedItem=lbCellsAlignment.jqxDropDownList("getSelectedItem");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.align=selectedItem.value;self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}if(itemType=="values"){var txtPrefix=self._settingsWindow.find(".txtPrefix");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.prefix=txtPrefix.val();self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}if(itemType=="values"){var txtDecimalPlaces=self._settingsWindow.find(".txtDecimalPlaces");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.decimalPlaces=txtDecimalPlaces.val();self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}if(itemType=="values"){var txtThousandsSeparator=self._settingsWindow.find(".txtThousandsSeparator");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.thousandsSeparator=txtThousandsSeparator.val();self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}if(itemType=="values"){var txtDecimalSeparator=self._settingsWindow.find(".txtDecimalSeparator");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.decimalSeparator=txtDecimalSeparator.val();self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}if(itemType=="values"){var checkBoxNagativeWithBrackets=self._settingsWindow.find(".checkBoxNagativeWithBrackets");var formatSettings=self._targetCurrentSettings[itemType][itemIndex].formatSettings||{};formatSettings.negativeWithBrackets=checkBoxNagativeWithBrackets.val();self._targetCurrentSettings[itemType][itemIndex].formatSettings=formatSettings}self._refreshPivotGrid(self._targetCurrentSettings)},_updateWindowData:function(){var self=this;var fieldSettings=self._windowData.fieldSettings;var itemValue=self._listBoxes[self._windowData.type].jqxListBox("getItem",self._windowData.itemIndex).value;var sourceBoundItems=self.target.source[self._windowData.type];var sourceBoundItem=undefined;for(var i=0;i
";self.host.append(windowElement);var width=300;var height=360;self._filtersWindow=self.host.find("#pivotFieldFiltersWindow").jqxWindow({title:self._getLocalizedString("fieldsettings"),position:{x:0,y:0},showCollapseButton:true,autoOpen:false,minWidth:width,maxWidth:width,width:width,height:height,initContent:function(){self._updateFiltersWindowData();var btnCancel=self._filtersWindow.find(".btnCancel").jqxButton({width:80});var btnOk=self._filtersWindow.find(".btnOk").jqxButton({width:80});btnCancel.on("click",function(){self._filtersWindow.jqxWindow("close")});btnOk.on("click",function(){self._applyFiltersWindowChanges();self._filtersWindow.jqxWindow("close")})}})},_updateFiltersWindowData:function(){var self=this;var fieldSettings=self._windowData.fieldSettings;var itemValue=self._listBoxes[self._windowData.type].jqxListBox("getItem",self._windowData.itemIndex).value;var sourceBoundItems=self.target.source[self._windowData.type];var sourceBoundItem=undefined;for(var i=0;i