Adds a @Input() showDeclaredFieldsOnly option which tells the grid to
avoid showing auto-generated columns by default and only show those
declared in the markup.
Also repairs a grid column sorting/insert bug where declared columns
would be displayed in the wrong order when mixed with auto columns.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
// the selected fields will be hidden.
@Input() hideFields: string;
// the selected fields will be hidden.
@Input() hideFields: string;
+ // When true, only display columns that are declared in the markup
+ // and leave all auto-generated fields hidden.
+ @Input() showDeclaredFieldsOnly: boolean;
+
// Allow the caller to jump directly to a specific page of
// grid data.
@Input() pageOffset: number;
// Allow the caller to jump directly to a specific page of
// grid data.
@Input() pageOffset: number;
this.context.showLinkSelectors = this.showLinkSelectors === true;
this.context.disableMultiSelect = this.disableMultiSelect === true;
this.context.rowFlairIsEnabled = this.rowFlairIsEnabled === true;
this.context.showLinkSelectors = this.showLinkSelectors === true;
this.context.disableMultiSelect = this.disableMultiSelect === true;
this.context.rowFlairIsEnabled = this.rowFlairIsEnabled === true;
+ this.context.showDeclaredFieldsOnly = this.showDeclaredFieldsOnly;
this.context.rowFlairCallback = this.rowFlairCallback;
this.context.disablePaging = this.disablePaging === true;
if (this.showFields) {
this.context.rowFlairCallback = this.rowFlairCallback;
this.context.disablePaging = this.disablePaging === true;
if (this.showFields) {
if (idx === 0) {
this.columns.unshift(col);
} else {
if (idx === 0) {
this.columns.unshift(col);
} else {
- this.columns.splice(idx - 1, 0, col);
+ this.columns.splice(idx, 0, col);
overflowCells: boolean;
showLinkSelectors: boolean;
disablePaging: boolean;
overflowCells: boolean;
showLinkSelectors: boolean;
disablePaging: boolean;
+ showDeclaredFieldsOnly: boolean;
// Allow calling code to know when the select-all-rows-in-page
// action has occurred.
// Allow calling code to know when the select-all-rows-in-page
// action has occurred.
+ if (this.showDeclaredFieldsOnly) {
+ col.hidden = true;
+ }
+
this.columnSet.add(col);
});
}
this.columnSet.add(col);
});
}