// the selected fields will be hidden.
@Input() hideFields: string;
+ // comma-separated list of fields to ignore when generating columns
+ // from the IDL.
+ // This does not imply all other fields should be available, only
+ // that the selected fields will be ignored.
+ @Input() ignoreFields: string;
+
// When true, only display columns that are declared in the markup
// and leave all auto-generated fields hidden.
@Input() showDeclaredFieldsOnly: boolean;
this.context.rowFlairCallback = this.rowFlairCallback;
this.context.disablePaging = this.disablePaging === true;
this.context.cellTextGenerator = this.cellTextGenerator;
+ this.context.ignoredFields = [];
if (this.showFields) {
this.context.defaultVisibleFields = this.showFields.split(',');
if (this.hideFields) {
this.context.defaultHiddenFields = this.hideFields.split(',');
}
+ if (this.ignoreFields) {
+ this.context.ignoredFields = this.ignoreFields.split(',');
+ }
if (this.pageOffset) {
this.context.pager.offset = this.pageOffset;
cellClassCallback: (row: any, col: GridColumn) => string;
defaultVisibleFields: string[];
defaultHiddenFields: string[];
+ ignoredFields: string[];
overflowCells: boolean;
disablePaging: boolean;
showDeclaredFieldsOnly: boolean;
this.idl.classes[this.columnSet.idlClass].fields
.filter(field => !field.virtual)
.forEach(field => {
- const col = new GridColumn();
- col.name = field.name;
- col.label = field.label || field.name;
- col.idlFieldDef = field;
- col.idlClass = this.columnSet.idlClass;
- col.datatype = field.datatype;
- col.isIndex = (field.name === pkeyField);
- col.isAuto = true;
-
- if (this.showDeclaredFieldsOnly) {
- col.hidden = true;
- }
+ if (!this.ignoredFields.filter(ignored => ignored === field.name).length) {
+ const col = new GridColumn();
+ col.name = field.name;
+ col.label = field.label || field.name;
+ col.idlFieldDef = field;
+ col.idlClass = this.columnSet.idlClass;
+ col.datatype = field.datatype;
+ col.isIndex = (field.name === pkeyField);
+ col.isAuto = true;
+
+ if (this.showDeclaredFieldsOnly) {
+ col.hidden = true;
+ }
- this.columnSet.add(col);
+ this.columnSet.add(col);
+ }
});
}