@@ -462,7 +462,8 @@ angular.module('apMesa.controllers.ApMesaController', [
462462 'glyphicon glyphicon-chevron-down'
463463 ] ,
464464 onRegisterApi : function ( api ) {
465- }
465+ } ,
466+ fixedWidthLayout : false
466467 } ;
467468 function defaults ( obj ) {
468469 if ( typeof obj !== 'object' ) {
@@ -596,6 +597,7 @@ angular.module('apMesa.controllers.ApMesaController', [
596597 function postLink ( scope , element ) {
597598 var deregStorageWatchers = [ ] ;
598599 scope . scrollDiv = element . find ( '.mesa-rows-table-wrapper' ) ;
600+ scope . wrapperDiv = element . find ( '.ap-mesa-wrapper' ) ;
599601 scope . $watch ( '_columns' , function ( columns , oldColumns ) {
600602 if ( columns !== scope . columns ) {
601603 resetColumns ( scope ) ;
@@ -639,6 +641,24 @@ angular.module('apMesa.controllers.ApMesaController', [
639641 resetState ( scope ) ;
640642 initOptions ( scope ) ;
641643 } ) ;
644+ scope . $watch ( 'options.fixedWidthLayout' , function ( newValue , oldValue ) {
645+ if ( newValue !== oldValue ) {
646+ if ( angular . isString ( scope . classes ) ) {
647+ if ( newValue && scope . classes . indexOf ( 'table-nonfluid' ) === - 1 ) {
648+ scope . classes = scope . classes + ' table-nonfluid' ;
649+ } else if ( ! newValue && scope . classes . indexOf ( 'table-nonfluid' ) > - 1 ) {
650+ scope . classes = scope . classes . split ( 'table-nonfluid' ) . join ( '' ) ;
651+ }
652+ if ( ! newValue && scope . classes . indexOf ( 'full-width' ) === - 1 ) {
653+ scope . classes = scope . classes + ' full-width' ;
654+ } else if ( newValue && scope . classes . indexOf ( 'full-width' ) > - 1 ) {
655+ scope . classes = scope . classes . split ( 'full-width' ) . join ( '' ) ;
656+ }
657+ }
658+ resetState ( scope ) ;
659+ initOptions ( scope ) ;
660+ }
661+ } ) ;
642662 scope . $watch ( 'options.storage' , function ( storage ) {
643663 if ( storage ) {
644664 if ( ! scope . options . storageKey ) {
@@ -2182,7 +2202,7 @@ angular.module('apMesa.templates', [
21822202angular . module ( 'src/templates/apMesa.tpl.html' , [ ] ) . run ( [
21832203 '$templateCache' ,
21842204 function ( $templateCache ) {
2185- $templateCache . put ( 'src/templates/apMesa.tpl.html' , '<div class="ap-mesa-wrapper" ng-class="{\n' + '\'paging-strategy-paginate\': options.pagingStrategy === \'PAGINATE\',\n' + '\'paging-strategy-scroll\': options.pagingStrategy === \'SCROLL\',\n' + '\'ap-mesa-loading-error\': !!transientState.loadingError,\n' + '\'ap-mesa-no-data\': !transientState.loading && !transientState.loadingError && visible_rows.length === 0\n' + '}">\n' + ' <table ng-class="classes" class="ap-mesa mesa-header-table">\n' + ' <thead>\n' + ' <!-- MAIN ROW OF COLUMN HEADERS -->\n' + ' <tr ui-sortable="sortableOptions" ng-model="enabledColumnObjects" class="ap-mesa-header-row">\n' + '\n' + ' <!-- COLUMN HEADERS -->\n' + ' <th\n' + ' scope="col"\n' + ' ng-repeat="column in enabledColumnObjects"\n' + ' ng-click="toggleSort($event,column)"\n' + ' ng-class="[\n' + ' {\n' + ' \'sortable-column\' : column.sort,\n' + ' \'select-column\': column.selector,\n' + ' \'is-sorting\': sortDirection[column.id]\n' + ' },\n' + ' \'table-header-\' + column.id,\n' + ' column.classes ? column.classes : \'\'\n' + ' ]"\n' + ' ng-attr-title="{{ column.title || \'\' }}"\n' + ' ng-style="{ width: column.width, \'min-width\': column.width, \'max-width\': column.width }">\n' + '\n' + ' <!-- COLUMN TEXT -->\n' + ' <span class="column-text">\n' + ' <input ng-if="column.selector" type="checkbox" ng-checked="isSelectedAll()" ng-click="toggleSelectAll($event)" />\n' + ' <span\n' + ' class="ap-mesa-sort-icon" \n' + ' ng-if="column.sort"\n' + ' title="This column is sortable. Click to toggle sort order. Hold shift while clicking multiple columns to stack sorting.">\n' + ' <span class="sorting-icon {{ getSortClass( sortDirection[column.id] ) }}"></span>\n' + ' <span ng-bind="transientState.sortPriority[column.id]" class="sort-priority" ng-if="transientState.sortPriorityShow && transientState.sortPriority[column.id]"></span>\n' + ' </span>\n' + ' <span class="ap-mesa-th-title" ap-mesa-th-title></span>\n' + ' </span>\n' + '\n' + ' <!-- COLUMN RESIZER -->\n' + ' <span\n' + ' ng-if="!column.lockWidth"\n' + ' class="column-resizer"\n' + ' ng-class="{\'discreet-width\': !!column.width}"\n' + ' title="Click and drag to set discreet width. Click once to clear discreet width."\n' + ' ng-mousedown="startColumnResize($event, column)">\n' + ' \n' + ' </span>\n' + '\n' + ' </th>\n' + ' </tr>\n' + '\n' + ' <!-- ROW OF COLUMMN FILTERS -->\n' + ' <tr ng-if="hasFilterFields() && transientState.showFiltersRow" class="ap-mesa-filter-row">\n' + '\n' + ' <!-- COLUMN FILTER CELLS -->\n' + ' <td ng-repeat="column in enabledColumnObjects" ng-class="\'column-\' + column.id">\n' + '\n' + ' <!-- FILTER INPUT -->\n' + ' <input\n' + ' type="text"\n' + ' ng-if="(column.filter)"\n' + ' ng-model="persistentState.searchTerms[column.id]"\n' + ' ng-attr-placeholder="{{ column.filterPlaceholder ? column.filterPlaceholder : (column.filter.placeholder || \'filter\') }}"\n' + ' ng-attr-title="{{ column.filter && column.filter.title }}"\n' + ' ng-class="{\'active\': persistentState.searchTerms[column.id] }">\n' + '\n' + ' <!-- FILTER CLEAR BUTTON -->\n' + ' <button\n' + ' ng-if="(column.filter)"\n' + ' ng-show="persistentState.searchTerms[column.id]"\n' + ' class="clear-search-btn"\n' + ' role="button"\n' + ' type="button"\n' + ' ng-click="clearAndFocusSearch(column.id)">\n' + ' ×\n' + ' </button>\n' + '\n' + ' </td>\n' + ' </tr>\n' + ' </thead>\n' + ' </table>\n' + ' <div ap-mesa-status-display></div>\n' + ' <div class="mesa-rows-table-wrapper" ng-style="tbodyNgStyle" ng-hide="transientState.loadingError">\n' + ' <table ng-class="classes" class="ap-mesa mesa-rows-table">\n' + ' <thead>\n' + ' <th\n' + ' scope="col"\n' + ' ng-repeat="column in enabledColumnObjects"\n' + ' ng-style="{ width: column.width, \'min-width\': column.width, \'max-width\': column.width }"\n' + ' ></th>\n' + ' </tr>\n' + ' </thead>\n' + ' <tbody ng-if="options.pagingStrategy === \'SCROLL\'" ap-mesa-dummy-rows="[0,transientState.rowOffset]" cell-content="..."></tbody>\n' + ' <tbody ap-mesa-rows class="ap-mesa-rendered-rows"></tbody>\n' + ' <tbody ng-if="options.pagingStrategy === \'SCROLL\'" ap-mesa-dummy-rows="[transientState.rowOffset + visible_rows.length, transientState.filterCount]" cell-content="..."></tbody>\n' + ' </table>\n' + ' </div>\n' + ' <div class="ap-mesa-pagination" ng-if="options.pagingStrategy === \'PAGINATE\'" ap-mesa-pagination-ctrls></div>\n' + '</div>\n' + '' ) ;
2205+ $templateCache . put ( 'src/templates/apMesa.tpl.html' , '<div>\n' + ' <div class="ap-mesa-wrapper" ng-class="{\n' + ' \'paging-strategy-paginate\': options.pagingStrategy === \'PAGINATE\',\n' + ' \'paging-strategy-scroll\': options.pagingStrategy === \'SCROLL\',\n' + ' \'ap-mesa-loading-error\': !!transientState.loadingError,\n' + ' \'ap-mesa-no-data\': !transientState.loading && !transientState.loadingError && visible_rows.length === 0\n' + ' }" ng-style="{ \'overflow-x\': options.fixedWidthLayout ? \'scroll\' : \'visible\' }">\n' + ' <table ng-class="classes" class="ap-mesa mesa-header-table">\n' + ' <thead>\n' + ' <!-- MAIN ROW OF COLUMN HEADERS -->\n' + ' <tr ui-sortable="sortableOptions" ng-model="enabledColumnObjects" class="ap-mesa-header-row">\n' + '\n' + ' <!-- COLUMN HEADERS -->\n' + ' <th\n' + ' scope="col"\n' + ' ng-repeat="column in enabledColumnObjects"\n' + ' ng-click="toggleSort($event,column)"\n' + ' ng-class="[\n' + ' {\n' + ' \'sortable-column\' : column.sort,\n' + ' \'select-column\': column.selector,\n' + ' \'is-sorting\': sortDirection[column.id]\n' + ' },\n' + ' \'table-header-\' + column.id,\n' + ' column.classes ? column.classes : \'\'\n' + ' ]"\n' + ' ng-attr-title="{{ column.title || \'\' }}"\n' + ' ng-style="{ width: options.fixedWidthLayout ? \'auto\' : column.width, \'min-width\': column.width, \'max-width\': column.width }">\n' + '\n' + ' <!-- COLUMN TEXT -->\n' + ' <span class="column-text">\n' + ' <input ng-if="column.selector" type="checkbox" ng-checked="isSelectedAll()" ng-click="toggleSelectAll($event)" />\n' + ' <span\n' + ' class="ap-mesa-sort-icon" \n' + ' ng-if="column.sort"\n' + ' title="This column is sortable. Click to toggle sort order. Hold shift while clicking multiple columns to stack sorting.">\n' + ' <span class="sorting-icon {{ getSortClass( sortDirection[column.id] ) }}"></span>\n' + ' <span ng-bind="transientState.sortPriority[column.id]" class="sort-priority" ng-if="transientState.sortPriorityShow && transientState.sortPriority[column.id]"></span>\n' + ' </span>\n' + ' <span class="ap-mesa-th-title" ap-mesa-th-title></span>\n' + ' </span>\n' + '\n' + ' <!-- COLUMN RESIZER -->\n' + ' <span\n' + ' ng-if="!column.lockWidth"\n' + ' class="column-resizer"\n' + ' ng-class="{\'discreet-width\': !!column.width}"\n' + ' title="Click and drag to set discreet width. Click once to clear discreet width."\n' + ' ng-mousedown="startColumnResize($event, column)">\n' + ' \n' + ' </span>\n' + '\n' + ' </th>\n' + ' </tr>\n' + '\n' + ' <!-- ROW OF COLUMMN FILTERS -->\n' + ' <tr ng-if="hasFilterFields() && transientState.showFiltersRow" class="ap-mesa-filter-row">\n' + '\n' + ' <!-- COLUMN FILTER CELLS -->\n' + ' <td ng-repeat="column in enabledColumnObjects" ng-class="\'column-\' + column.id">\n' + '\n' + ' <!-- FILTER INPUT -->\n' + ' <input\n' + ' type="text"\n' + ' ng-if="(column.filter)"\n' + ' ng-model="persistentState.searchTerms[column.id]"\n' + ' ng-attr-placeholder="{{ column.filterPlaceholder ? column.filterPlaceholder : (column.filter.placeholder || \'filter\') }}"\n' + ' ng-attr-title="{{ column.filter && column.filter.title }}"\n' + ' ng-class="{\'active\': persistentState.searchTerms[column.id] }"\n' + ' ng-style="{\'width\': options.fixedWidthLayout ? column.width : \'100%\'}">\n' + '\n' + ' <!-- FILTER CLEAR BUTTON -->\n' + ' <button\n' + ' ng-if="(column.filter)"\n' + ' ng-show="persistentState.searchTerms[column.id]"\n' + ' class="clear-search-btn"\n' + ' role="button"\n' + ' type="button"\n' + ' ng-click="clearAndFocusSearch(column.id)">\n' + ' ×\n' + ' </button>\n' + '\n' + ' </td>\n' + ' </tr>\n' + ' </thead>\n' + ' </table>\n' + ' <div ap-mesa-status-display></div>\n' + ' <div class="mesa-rows-table-wrapper" ng-style="tbodyNgStyle" ng-hide="transientState.loadingError"\n' + ' ng-class="{\n' + ' \'fixed-width-layout\': options.fixedWidthLayout,\n' + ' \'auto-layout\': !options.fixedWidthLayout\n' + ' }">\n' + ' <table ng-class="classes" class="ap-mesa mesa-rows-table">\n' + ' <thead>\n' + ' <colgroup ng-if="options.fixedWidthLayout">\n' + ' <col ng-repeat="column in enabledColumnObjects"\n' + ' ng-style="{ width: column.width }"\n' + ' />\n' + ' </colgroup>\n' + ' <th\n' + ' scope="col"\n' + ' ng-repeat="column in enabledColumnObjects"\n' + ' ng-style="{ width: options.fixedWidthLayout ? \'auto\' : column.width, \'min-width\': column.width, \'max-width\': column.width }"\n' + ' ></th>\n' + ' </tr>\n' + ' </thead>\n' + ' <tbody ng-if="options.pagingStrategy === \'SCROLL\'" ap-mesa-dummy-rows="[0,transientState.rowOffset]" cell-content="..."></tbody>\n' + ' <tbody ap-mesa-rows class="ap-mesa-rendered-rows"></tbody>\n' + ' <tbody ng-if="options.pagingStrategy === \'SCROLL\'" ap-mesa-dummy-rows="[transientState.rowOffset + visible_rows.length, transientState.filterCount]" cell-content="..."></tbody>\n' + ' </table>\n' + ' </div>\n' + ' </div>\n' + ' <div class="ap-mesa-pagination" ng-if="options.pagingStrategy === \'PAGINATE\'" ap-mesa-pagination-ctrls></div>\n' + '</div>' ) ;
21862206 }
21872207] ) ;
21882208angular . module ( 'src/templates/apMesaDummyRows.tpl.html' , [ ] ) . run ( [
0 commit comments