3 var ColumnComponent =
function (column){
5 this.type =
"ColumnComponent";
8 ColumnComponent.prototype.getElement =
function(){
9 return this._column.getElement();
12 ColumnComponent.prototype.getDefinition =
function(){
13 return this._column.getDefinition();
16 ColumnComponent.prototype.getField =
function(){
17 return this._column.getField();
20 ColumnComponent.prototype.getCells =
function(){
23 this._column.cells.forEach(
function(cell){
24 cells.push(cell.getComponent());
30 ColumnComponent.prototype.getVisibility =
function(){
31 return this._column.visible;
34 ColumnComponent.prototype.show =
function(){
35 if(this._column.isGroup){
36 this._column.columns.forEach(
function(column){
44 ColumnComponent.prototype.hide =
function(){
45 if(this._column.isGroup){
46 this._column.columns.forEach(
function(column){
54 ColumnComponent.prototype.toggle =
function(){
55 if(this._column.visible){
62 ColumnComponent.prototype.delete =
function(){
63 return this._column.delete();
66 ColumnComponent.prototype.getSubColumns =
function(){
69 if(this._column.columns.length){
70 this._column.columns.forEach(
function(column){
71 output.push(column.getComponent());
78 ColumnComponent.prototype.getParentColumn =
function(){
79 return this._column.parent instanceof Column ? this._column.parent.getComponent() :
false;
83 ColumnComponent.prototype._getSelf =
function(){
87 ColumnComponent.prototype.scrollTo =
function(){
88 return this._column.table.columnManager.scrollToColumn(this._column);
91 ColumnComponent.prototype.getTable =
function(){
92 return this._column.table;
95 ColumnComponent.prototype.headerFilterFocus =
function(){
96 if(this._column.table.modExists(
"filter",
true)){
97 this._column.table.modules.filter.setHeaderFilterFocus(this._column);
101 ColumnComponent.prototype.reloadHeaderFilter =
function(){
102 if(this._column.table.modExists(
"filter",
true)){
103 this._column.table.modules.filter.reloadHeaderFilter(this._column);
107 ColumnComponent.prototype.setHeaderFilterValue =
function(value){
108 if(this._column.table.modExists(
"filter",
true)){
109 this._column.table.modules.filter.setHeaderFilterValue(this._column, value);
113 ColumnComponent.prototype.move =
function(to, after){
114 var toColumn = this._column.table.columnManager.findColumn(to);
117 this._column.table.columnManager.moveColumn(this._column, toColumn, after)
119 console.warn(
"Move Error - No matching column found:", toColumn);
123 ColumnComponent.prototype.getNextColumn =
function(){
124 var nextCol = this._column.nextColumn();
126 return nextCol ? nextCol.getComponent() :
false;
129 ColumnComponent.prototype.getPrevColumn =
function(){
130 var prevCol = this._column.prevColumn();
132 return prevCol ? prevCol.getComponent() :
false;
135 ColumnComponent.prototype.updateDefinition =
function(updates){
136 return this._column.updateDefinition(updates);
141 var Column =
function(def, parent){
144 this.table = parent.table;
145 this.definition = def;
146 this.parent = parent;
147 this.type =
"column";
150 this.element = this.createElement();
151 this.contentElement =
false;
152 this.groupElement = this.createGroupElement();
153 this.isGroup =
false;
154 this.tooltip =
false;
159 this.fieldStructure =
"";
160 this.getFieldValue =
"";
161 this.setFieldValue =
"";
163 this.titleFormatterRendered =
false;
165 this.setField(this.definition.field);
167 if(this.table.options.invalidOptionWarnings){
168 this.checkDefinition();
180 cellMouseEnter:
false,
181 cellMouseLeave:
false,
188 this.widthStyled =
"";
189 this.minWidth = null;
190 this.minWidthStyled =
"";
191 this.widthFixed =
false;
195 this._mapDepricatedFunctionality();
202 def.columns.forEach(
function(def, i){
203 var newCol =
new Column(def,
self);
204 self.attachColumn(newCol);
207 self.checkColumnVisibility();
209 parent.registerColumnField(
this);
212 if(def.rowHandle &&
this.table.options.movableRows !==
false &&
this.table.modExists(
"moveRow")){
213 this.table.modules.moveRow.setHandle(
true);
218 this.bindModuleColumns();
221 Column.prototype.createElement =
function (){
222 var el = document.createElement(
"div");
224 el.classList.add(
"tabulator-col");
225 el.setAttribute(
"role",
"columnheader");
226 el.setAttribute(
"aria-sort",
"none");
231 Column.prototype.createGroupElement =
function (){
232 var el = document.createElement(
"div");
234 el.classList.add(
"tabulator-col-group-cols");
239 Column.prototype.checkDefinition =
function(){
240 Object.keys(this.definition).forEach((key) => {
241 if(this.defaultOptionList.indexOf(key) === -1){
242 console.warn(
"Invalid column definition option in '" + (this.field || this.definition.title) +
"' column:", key)
247 Column.prototype.setField =
function(field){
249 this.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];
250 this.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;
251 this.setFieldValue = this.fieldStructure.length > 1 ? this._setNesteData : this._setFlatData;
255 Column.prototype.registerColumnPosition =
function(column){
256 this.parent.registerColumnPosition(column);
260 Column.prototype.registerColumnField =
function(column){
261 this.parent.registerColumnField(column);
265 Column.prototype.reRegisterPosition =
function(){
267 this.columns.forEach(
function(column){
268 column.reRegisterPosition();
271 this.registerColumnPosition(
this);
275 Column.prototype._mapDepricatedFunctionality =
function(){
276 if(typeof this.definition.hideInHtml !==
"undefined"){
277 this.definition.htmlOutput = !this.definition.hideInHtml;
278 console.warn(
"hideInHtml column definition property is deprecated, you should now use htmlOutput")
282 Column.prototype.setTooltip =
function(){
284 def =
self.definition;
287 var tooltip = def.headerTooltip || def.tooltip ===
false ? def.headerTooltip :
self.table.options.tooltipsHeader;
290 if(tooltip ===
true){
292 self.table.modules.localize.bind(
"columns|" + def.field,
function(value){
293 self.element.setAttribute(
"title", value || def.title);
296 self.element.setAttribute(
"title", def.title);
300 if(typeof(tooltip) ==
"function"){
301 tooltip = tooltip(
self.getComponent());
303 if(tooltip ===
false){
308 self.element.setAttribute(
"title", tooltip);
312 self.element.setAttribute(
"title",
"");
317 Column.prototype._buildHeader =
function(){
319 def =
self.definition;
321 while(
self.element.firstChild)
self.element.removeChild(
self.element.firstChild);
323 if(def.headerVertical){
324 self.element.classList.add(
"tabulator-col-vertical");
326 if(def.headerVertical ===
"flip"){
327 self.element.classList.add(
"tabulator-col-vertical-flip");
331 self.contentElement =
self._bindEvents();
333 self.contentElement =
self._buildColumnHeaderContent();
335 self.element.appendChild(
self.contentElement);
338 self._buildGroupHeader();
340 self._buildColumnHeader();
346 if(
self.table.options.resizableColumns &&
self.table.modExists(
"resizeColumns")){
347 self.table.modules.resizeColumns.initializeColumn(
"header",
self,
self.element);
351 if(def.headerFilter &&
self.table.modExists(
"filter") &&
self.table.modExists(
"edit")){
352 if(typeof def.headerFilterPlaceholder !==
"undefined" && def.field){
353 self.table.modules.localize.setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);
356 self.table.modules.filter.initializeColumn(
self);
361 if(
self.table.modExists(
"frozenColumns")){
362 self.table.modules.frozenColumns.initializeColumn(
self);
366 if(
self.table.options.movableColumns && !
self.isGroup &&
self.table.modExists(
"moveColumn")){
367 self.table.modules.moveColumn.initializeColumn(
self);
371 if((def.topCalc || def.bottomCalc) &&
self.table.modExists(
"columnCalcs")){
372 self.table.modules.columnCalcs.initializeColumn(
self);
376 if(
self.table.modExists(
"persistence") &&
self.table.modules.persistence.config.columns){
377 self.table.modules.persistence.initializeColumn(
self);
382 self.element.addEventListener(
"mouseenter",
function(e){
387 Column.prototype._bindEvents =
function(){
390 def =
self.definition,
391 dblTap, tapHold, tap;
394 if(typeof(def.headerClick) ==
"function"){
395 self.element.addEventListener(
"click",
function(e){def.headerClick(e,
self.getComponent());});
398 if(typeof(def.headerDblClick) ==
"function"){
399 self.element.addEventListener(
"dblclick",
function(e){def.headerDblClick(e,
self.getComponent());});
402 if(typeof(def.headerContext) ==
"function"){
403 self.element.addEventListener(
"contextmenu",
function(e){def.headerContext(e,
self.getComponent());});
407 if(typeof(def.headerTap) ==
"function"){
410 self.element.addEventListener(
"touchstart",
function(e){
414 self.element.addEventListener(
"touchend",
function(e){
416 def.headerTap(e,
self.getComponent());
423 if(typeof(def.headerDblTap) ==
"function"){
426 self.element.addEventListener(
"touchend",
function(e){
429 clearTimeout(dblTap);
432 def.headerDblTap(e,
self.getComponent());
435 dblTap = setTimeout(
function(){
436 clearTimeout(dblTap);
444 if(typeof(def.headerTapHold) ==
"function"){
447 self.element.addEventListener(
"touchstart",
function(e){
448 clearTimeout(tapHold);
450 tapHold = setTimeout(
function(){
451 clearTimeout(tapHold);
454 def.headerTapHold(e,
self.getComponent());
459 self.element.addEventListener(
"touchend",
function(e){
460 clearTimeout(tapHold);
466 if(typeof(def.cellClick) ==
"function"){
467 self.cellEvents.cellClick = def.cellClick;
470 if(typeof(def.cellDblClick) ==
"function"){
471 self.cellEvents.cellDblClick = def.cellDblClick;
474 if(typeof(def.cellContext) ==
"function"){
475 self.cellEvents.cellContext = def.cellContext;
479 if(typeof(def.cellMouseEnter) ==
"function"){
480 self.cellEvents.cellMouseEnter = def.cellMouseEnter;
483 if(typeof(def.cellMouseLeave) ==
"function"){
484 self.cellEvents.cellMouseLeave = def.cellMouseLeave;
487 if(typeof(def.cellMouseOver) ==
"function"){
488 self.cellEvents.cellMouseOver = def.cellMouseOver;
491 if(typeof(def.cellMouseOut) ==
"function"){
492 self.cellEvents.cellMouseOut = def.cellMouseOut;
495 if(typeof(def.cellMouseMove) ==
"function"){
496 self.cellEvents.cellMouseMove = def.cellMouseMove;
500 if(typeof(def.cellTap) ==
"function"){
501 self.cellEvents.cellTap = def.cellTap;
504 if(typeof(def.cellDblTap) ==
"function"){
505 self.cellEvents.cellDblTap = def.cellDblTap;
508 if(typeof(def.cellTapHold) ==
"function"){
509 self.cellEvents.cellTapHold = def.cellTapHold;
513 if(typeof(def.cellEdited) ==
"function"){
514 self.cellEvents.cellEdited = def.cellEdited;
517 if(typeof(def.cellEditing) ==
"function"){
518 self.cellEvents.cellEditing = def.cellEditing;
521 if(typeof(def.cellEditCancelled) ==
"function"){
522 self.cellEvents.cellEditCancelled = def.cellEditCancelled;
527 Column.prototype._buildColumnHeader =
function(){
529 def =
self.definition,
534 if(table.modExists(
"sort")){
535 table.modules.sort.initializeColumn(
self,
self.contentElement);
539 if(table.modExists(
"format")){
540 table.modules.format.initializeColumn(
self);
544 if(typeof def.editor !=
"undefined" && table.modExists(
"edit")){
545 table.modules.edit.initializeColumn(
self);
549 if(typeof def.validator !=
"undefined" && table.modExists(
"validate")){
550 table.modules.validate.initializeColumn(
self);
555 if(table.modExists(
"mutator")){
556 table.modules.mutator.initializeColumn(
self);
560 if(table.modExists(
"accessor")){
561 table.modules.accessor.initializeColumn(
self);
565 if(typeof table.options.responsiveLayout && table.modExists(
"responsiveLayout")){
566 table.modules.responsiveLayout.initializeColumn(
self);
570 if(typeof def.visible !=
"undefined"){
580 var classeNames = def.cssClass.split(
" ");
581 classeNames.forEach(
function(className) {
582 self.element.classList.add(className)
587 this.element.setAttribute(
"tabulator-field", def.field);
591 self.setMinWidth(typeof def.minWidth ==
"undefined" ?
self.table.options.columnMinWidth : parseInt(def.minWidth));
593 self.reinitializeWidth();
596 self.tooltip =
self.definition.tooltip ||
self.definition.tooltip ===
false ?
self.definition.tooltip :
self.table.options.tooltips;
599 self.hozAlign = typeof(
self.definition.align) ==
"undefined" ?
"" :
self.definition.align;
602 Column.prototype._buildColumnHeaderContent =
function(){
604 def =
self.definition,
607 var contentElement = document.createElement(
"div");
608 contentElement.classList.add(
"tabulator-col-content");
610 contentElement.appendChild(
self._buildColumnHeaderTitle());
612 return contentElement;
616 Column.prototype._buildColumnHeaderTitle =
function(){
618 def =
self.definition,
622 var titleHolderElement = document.createElement(
"div");
623 titleHolderElement.classList.add(
"tabulator-col-title");
625 if(def.editableTitle){
626 var titleElement = document.createElement(
"input");
627 titleElement.classList.add(
"tabulator-title-editor");
629 titleElement.addEventListener(
"click",
function(e){
631 titleElement.focus();
634 titleElement.addEventListener(
"change",
function(){
635 def.title = titleElement.value;
636 table.options.columnTitleChanged.call(
self.table,
self.getComponent());
639 titleHolderElement.appendChild(titleElement);
642 table.modules.localize.bind(
"columns|" + def.field,
function(text){
643 titleElement.value = text || (def.title ||
" ");
646 titleElement.value = def.title ||
" ";
651 table.modules.localize.bind(
"columns|" + def.field,
function(text){
652 self._formatColumnHeaderTitle(titleHolderElement, text || (def.title ||
" "));
655 self._formatColumnHeaderTitle(titleHolderElement, def.title ||
" ");
659 return titleHolderElement;
662 Column.prototype._formatColumnHeaderTitle =
function(el, title){
663 var formatter, contents, params, mockCell, onRendered;
665 if(this.definition.titleFormatter &&
this.table.modExists(
"format")){
667 formatter = this.table.modules.format.getFormatter(this.definition.titleFormatter);
669 onRendered = (callback) => {
670 this.titleFormatterRendered = callback;
677 getElement:
function(){
682 params = this.definition.titleFormatterParams || {};
684 params = typeof params ===
"function" ? params() : params;
686 contents = formatter.call(this.table.modules.format, mockCell, params, onRendered);
688 switch(typeof contents){
690 if(contents instanceof Node){
691 el.appendChild(contents);
694 console.warn(
"Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:", contents);
702 el.innerHTML = contents;
705 el.innerHTML = title;
711 Column.prototype._buildGroupHeader =
function(){
712 this.element.classList.add(
"tabulator-col-group");
713 this.element.setAttribute(
"role",
"columngroup");
714 this.element.setAttribute(
"aria-title", this.definition.title);
717 if(this.definition.cssClass){
718 var classeNames = this.definition.cssClass.split(
" ");
719 classeNames.forEach((className) => {
720 this.element.classList.add(className);
724 this.element.appendChild(this.groupElement);
728 Column.prototype._getFlatData =
function(data){
729 return data[this.field];
733 Column.prototype._getNestedData =
function(data){
735 structure = this.fieldStructure,
736 length = structure.length,
739 for(let i = 0; i < length; i++){
741 dataObj = dataObj[structure[i]];
754 Column.prototype._setFlatData =
function(data, value){
756 data[this.field] = value;
761 Column.prototype._setNesteData =
function(data, value){
763 structure = this.fieldStructure,
764 length = structure.length;
766 for(let i = 0; i < length; i++){
769 dataObj[structure[i]] = value;
771 if(!dataObj[structure[i]]){
772 dataObj[structure[i]] = {};
775 dataObj = dataObj[structure[i]];
782 Column.prototype.attachColumn =
function(column){
785 if(
self.groupElement){
786 self.columns.push(column);
787 self.groupElement.appendChild(column.getElement());
789 console.warn(
"Column Warning - Column being attached to another column instead of column group");
794 Column.prototype.verticalAlign =
function(alignment, height){
797 var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);
800 this.element.style.height = parentHeight +
"px";
803 this.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) +
"px";
807 if(!this.isGroup && alignment !==
"top"){
808 if(alignment ===
"bottom"){
809 this.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) +
"px";
811 this.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) +
"px";
815 this.columns.forEach(
function(column){
816 column.verticalAlign(alignment);
821 Column.prototype.clearVerticalAlign =
function(){
822 this.element.style.paddingTop =
"";
823 this.element.style.height =
"";
824 this.element.style.minHeight =
"";
825 this.groupElement.style.minHeight =
"";
827 this.columns.forEach(
function(column){
828 column.clearVerticalAlign();
832 Column.prototype.bindModuleColumns =
function (){
834 if(this.definition.formatter ==
"rownum"){
835 this.table.rowManager.rowNumColumn =
this;
843 Column.prototype.getElement =
function(){
848 Column.prototype.getGroupElement =
function(){
849 return this.groupElement;
853 Column.prototype.getField =
function(){
858 Column.prototype.getFirstColumn =
function(){
862 if(this.columns.length){
863 return this.columns[0].getFirstColumn();
871 Column.prototype.getLastColumn =
function(){
875 if(this.columns.length){
876 return this.columns[this.columns.length -1].getLastColumn();
884 Column.prototype.getColumns =
function(){
889 Column.prototype.getCells =
function(){
894 Column.prototype.getTopColumn =
function(){
895 if(this.parent.isGroup){
896 return this.parent.getTopColumn();
903 Column.prototype.getDefinition =
function(updateBranches){
906 if(this.isGroup && updateBranches){
907 this.columns.forEach(
function(column){
908 colDefs.push(column.getDefinition(
true));
911 this.definition.columns = colDefs;
914 return this.definition;
919 Column.prototype.checkColumnVisibility =
function(){
922 this.columns.forEach(
function(column){
932 this.parent.table.options.columnVisibilityChanged.call(this.table, this.getComponent(),
false);
940 Column.prototype.show =
function(silent, responsiveToggle){
944 this.element.style.display =
"";
946 if(this.parent.isGroup){
947 this.parent.checkColumnVisibility();
950 this.cells.forEach(
function(cell){
954 if(!this.isGroup && this.width === null){
955 this.reinitializeWidth();
958 this.table.columnManager._verticalAlignHeaders();
960 if(this.table.options.persistence &&
this.table.modExists(
"persistence",
true) && this.table.modules.persistence.config.columns){
961 this.table.modules.persistence.save(
"columns");
964 if(!responsiveToggle && this.table.options.responsiveLayout &&
this.table.modExists(
"responsiveLayout",
true)){
965 this.table.modules.responsiveLayout.updateColumnVisibility(
this, this.visible);
969 this.table.options.columnVisibilityChanged.call(this.table, this.getComponent(),
true);
972 if(this.parent.isGroup){
973 this.parent.matchChildWidths();
979 Column.prototype.hide =
function(silent, responsiveToggle){
981 this.visible =
false;
983 this.element.style.display =
"none";
985 this.table.columnManager._verticalAlignHeaders();
987 if(this.parent.isGroup){
988 this.parent.checkColumnVisibility();
991 this.cells.forEach(
function(cell){
995 if(this.table.options.persistence &&
this.table.modExists(
"persistence",
true) && this.table.modules.persistence.config.columns){
996 this.table.modules.persistence.save(
"columns");
999 if(!responsiveToggle && this.table.options.responsiveLayout &&
this.table.modExists(
"responsiveLayout",
true)){
1000 this.table.modules.responsiveLayout.updateColumnVisibility(
this, this.visible);
1004 this.table.options.columnVisibilityChanged.call(this.table, this.getComponent(),
false);
1007 if(this.parent.isGroup){
1008 this.parent.matchChildWidths();
1013 Column.prototype.matchChildWidths =
function(){
1016 if(this.contentElement && this.columns.length){
1017 this.columns.forEach(
function(column){
1019 childWidth += column.getWidth();
1023 this.contentElement.style.maxWidth = (childWidth - 1) +
"px";
1027 Column.prototype.setWidth =
function(width){
1028 this.widthFixed =
true;
1029 this.setWidthActual(width);
1032 Column.prototype.setWidthActual =
function(width){
1034 width = Math.floor((this.table.element.clientWidth/100) * parseInt(width));
1037 width = Math.max(this.minWidth, width);
1040 this.widthStyled = width ? width +
"px" :
"";
1042 this.element.style.width = this.widthStyled;
1045 this.cells.forEach(
function(cell){
1050 if(this.parent.isGroup){
1051 this.parent.matchChildWidths();
1055 if(this.table.modExists(
"frozenColumns")){
1056 this.table.modules.frozenColumns.layout();
1061 Column.prototype.checkCellHeights =
function(){
1064 this.cells.forEach(
function(cell){
1065 if(cell.row.heightInitialized){
1066 if(cell.row.getElement().offsetParent !== null){
1067 rows.push(cell.row);
1068 cell.row.clearCellHeight();
1070 cell.row.heightInitialized =
false;
1075 rows.forEach(
function(row){
1079 rows.forEach(
function(row){
1080 row.setCellHeight();
1084 Column.prototype.getWidth =
function(){
1089 Column.prototype.getHeight =
function(){
1090 return this.element.offsetHeight;
1093 Column.prototype.setMinWidth =
function(minWidth){
1094 this.minWidth = minWidth;
1095 this.minWidthStyled = minWidth ? minWidth +
"px" :
"";
1097 this.element.style.minWidth = this.minWidthStyled;
1099 this.cells.forEach(
function(cell){
1104 Column.prototype.delete =
function(){
1105 return new Promise((resolve, reject) => {
1108 this.columns.forEach(
function(column){
1113 var cellCount = this.cells.length;
1115 for(let i = 0; i < cellCount; i++){
1116 this.cells[0].delete();
1119 this.element.parentNode.removeChild(this.element);
1121 this.table.columnManager.deregisterColumn(
this);
1127 Column.prototype.columnRendered =
function(){
1128 if(this.titleFormatterRendered){
1129 this.titleFormatterRendered();
1136 Column.prototype.generateCell =
function(row){
1139 var cell =
new Cell(
self, row);
1141 this.cells.push(cell);
1146 Column.prototype.nextColumn =
function(){
1147 var index = this.table.columnManager.findColumnIndex(
this);
1148 return index > -1 ? this._nextVisibleColumn(index + 1) : false;
1151 Column.prototype._nextVisibleColumn =
function(index){
1152 var column = this.table.columnManager.getColumnByIndex(index);
1153 return !column || column.visible ? column : this._nextVisibleColumn(index + 1);
1156 Column.prototype.prevColumn =
function(){
1157 var index = this.table.columnManager.findColumnIndex(
this);
1158 return index > -1 ? this._prevVisibleColumn(index - 1) : false;
1161 Column.prototype._prevVisibleColumn =
function(index){
1162 var column = this.table.columnManager.getColumnByIndex(index);
1163 return !column || column.visible ? column : this._prevVisibleColumn(index - 1);
1166 Column.prototype.reinitializeWidth =
function(force){
1167 this.widthFixed =
false;
1170 if(typeof this.definition.width !==
"undefined" && !force){
1171 this.setWidth(this.definition.width);
1175 if(this.table.modExists(
"filter")){
1176 this.table.modules.filter.hideHeaderFilterElements();
1182 if(this.table.modExists(
"filter")){
1183 this.table.modules.filter.showHeaderFilterElements();
1188 Column.prototype.fitToData =
function(){
1191 if(!this.widthFixed){
1192 this.element.style.width =
"";
1194 self.cells.forEach(
function(cell){
1199 var maxWidth = this.element.offsetWidth;
1201 if(!
self.width || !this.widthFixed){
1202 self.cells.forEach(
function(cell){
1203 var width = cell.getWidth();
1205 if(width > maxWidth){
1211 self.setWidthActual(maxWidth + 1);
1217 Column.prototype.updateDefinition =
function(updates){
1218 return new Promise((resolve, reject) => {
1222 definition = Object.assign({}, this.getDefinition());
1223 definition = Object.assign(definition, updates);
1225 this.table.columnManager.addColumn(definition,
false,
this)
1228 if(definition.field ==
this.field){
1234 resolve(column.getComponent());
1243 console.warn(
"Column Update Error - The updateDefintion function is only available on columns, not column groups");
1244 reject(
"Column Update Error - The updateDefintion function is only available on columns, not column groups");
1250 Column.prototype.deleteCell =
function(cell){
1251 var index = this.cells.indexOf(cell);
1254 this.cells.splice(index, 1);
1259 Column.prototype.defaultOptionList = [
1290 "mutatorDataParams",
1292 "mutatorEditParams",
1294 "mutatorClipboardParams",
1298 "accessorDataParams",
1300 "accessorDownloadParams",
1301 "accessorClipboard",
1302 "accessorClipboardParams",
1309 "topCalcFormatterParams",
1312 "bottomCalcFormatter",
1313 "bottomCalcFormatterParams",
1327 "cellEditCancelled",
1329 "headerSortStartingDir",
1330 "headerSortTristate",
1341 "titleFormatterParams",
1343 "headerFilterPlaceholder",
1344 "headerFilterParams",
1345 "headerFilterEmptyCheck",
1347 "headerFilterFuncParams",
1348 "headerFilterLiveFilter",
1355 Column.prototype.getComponent =
function(){
1356 return new ColumnComponent(
this);