Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
defineGrid() {
this.columnDefinitions = [
{ id: 'title', name: 'Title', field: 'title', headerKey: 'TITLE', formatter: this.taskTranslateFormatter, sortable: true, minWidth: 100, filterable: true },
{ id: 'duration', name: 'Duration (days)', field: 'duration', headerKey: 'DURATION', sortable: true, minWidth: 100, filterable: true },
{ id: 'start', name: 'Start', field: 'start', headerKey: 'START', formatter: Formatters.dateIso, minWidth: 100, filterable: true },
{ id: 'finish', name: 'Finish', field: 'finish', headerKey: 'FINISH', formatter: Formatters.dateIso, minWidth: 100, filterable: true },
{
id: 'completed', name: 'Completed', field: 'completed', headerKey: 'COMPLETED', formatter: Formatters.translate, params: { i18n: this.i18n }, sortable: true,
minWidth: 100,
filterable: true,
filter: {
searchTerm: '', // default selection
type: FormElementType.select,
selectOptions: [{ value: '', label: '' }, { value: 'TRUE', labelKey: 'TRUE' }, { value: 'FALSE', labelKey: 'FALSE' }]
}
}
// OR via your own custom translate formatter
// { id: 'completed', name: 'Completed', field: 'completed', headerKey: 'COMPLETED', formatter: translateFormatter, sortable: true, minWidth: 100 }
];
this.gridOptions = {
autoResize: {
containerId: 'demo-container',
groupTotalsFormatter: GroupTotalFormatters.sumTotals,
params: { groupFormatterPrefix: 'Total: ' }
},
{
id: '%', name: '% Complete', field: 'percentComplete',
minWidth: 70, width: 90,
formatter: Formatters.percentCompleteBar,
sortable: true,
groupTotalsFormatter: GroupTotalFormatters.avgTotalsPercentage,
params: { groupFormatterPrefix: '<i>Avg</i>: ' }
},
{
id: 'start', name: 'Start', field: 'start',
minWidth: 60,
sortable: true,
formatter: Formatters.dateIso,
exportWithFormatter: true
},
{
id: 'finish', name: 'Finish', field: 'finish',
minWidth: 60,
sortable: true,
formatter: Formatters.dateIso,
exportWithFormatter: true
},
{
id: 'cost', name: 'Cost', field: 'cost',
minWidth: 70,
width: 100,
sortable: true,
exportWithFormatter: true,
formatter: Formatters.dollar,
sortable: true,
groupTotalsFormatter: GroupTotalFormatters.avgTotalsPercentage,
params: { groupFormatterPrefix: '<i>Avg</i>: ' }
},
{
id: 'start', name: 'Start', field: 'start',
minWidth: 60,
sortable: true,
formatter: Formatters.dateIso,
exportWithFormatter: true
},
{
id: 'finish', name: 'Finish', field: 'finish',
minWidth: 60,
sortable: true,
formatter: Formatters.dateIso,
exportWithFormatter: true
},
{
id: 'cost', name: 'Cost', field: 'cost',
minWidth: 70,
width: 100,
sortable: true,
exportWithFormatter: true,
formatter: Formatters.dollar,
groupTotalsFormatter: GroupTotalFormatters.sumTotalsDollar,
params: { groupFormatterPrefix: '<b>Total</b>: ' /*, groupFormatterSuffix: ' USD'*/ }
},
{
id: 'effort-driven', name: 'Effort Driven',
minWidth: 20, width: 80, maxWidth: 80,
cssClass: 'cell-effort-driven',
defineGrid() {
this.columnDefinitions = [
{ id: 'title', name: 'Title', field: 'title', sortable: true, type: FieldType.string, width: 70 },
{ id: 'phone', name: 'Phone Number using mask', field: 'phone', sortable: true, type: FieldType.number, minWidth: 100, formatter: Formatters.mask, params: { mask: '(000) 000-0000' } },
{ id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true, type: FieldType.number, minWidth: 90 },
{ id: 'complete', name: '% Complete', field: 'percentComplete', formatter: Formatters.percentCompleteBar, type: FieldType.number, sortable: true, minWidth: 100 },
{ id: 'percent2', name: '% Complete', field: 'percentComplete2', formatter: Formatters.progressBar, type: FieldType.number, sortable: true, minWidth: 100 },
{ id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso, sortable: true, type: FieldType.date, minWidth: 90, exportWithFormatter: true },
{ id: 'finish', name: 'Finish', field: 'finish', formatter: Formatters.dateIso, sortable: true, type: FieldType.date, minWidth: 90, exportWithFormatter: true },
{ id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', formatter: myCustomCheckmarkFormatter, type: FieldType.number, sortable: true, minWidth: 100 }
];
this.gridOptions = {
autoResize: {
containerId: 'demo-container',
sidePadding: 15
},
enableExcelCopyBuffer: true
};
}
defineGrid() {
this.columnDefinitions = [
{ id: 'title', name: 'Title', field: 'title', sortable: true, type: FieldType.string, width: 70 },
{ id: 'phone', name: 'Phone Number using mask', field: 'phone', sortable: true, type: FieldType.number, minWidth: 100, formatter: Formatters.mask, params: { mask: '(000) 000-0000' } },
{ id: 'duration', name: 'Duration (days)', field: 'duration', formatter: Formatters.decimal, params: { minDecimalPlaces: 1, maxDecimalPlaces: 2 }, sortable: true, type: FieldType.number, minWidth: 90 },
{ id: 'complete', name: '% Complete', field: 'percentComplete', formatter: Formatters.percentCompleteBar, type: FieldType.number, sortable: true, minWidth: 100 },
{ id: 'percent2', name: '% Complete', field: 'percentComplete2', formatter: Formatters.progressBar, type: FieldType.number, sortable: true, minWidth: 100 },
{ id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso, sortable: true, type: FieldType.date, minWidth: 90, exportWithFormatter: true },
{ id: 'finish', name: 'Finish', field: 'finish', formatter: Formatters.dateIso, sortable: true, type: FieldType.date, minWidth: 90, exportWithFormatter: true },
{ id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', formatter: myCustomCheckmarkFormatter, type: FieldType.number, sortable: true, minWidth: 100 }
];
this.gridOptions = {
autoResize: {
containerId: 'demo-container',
sidePadding: 15
},
enableCellNavigation: true,
enableExcelCopyBuffer: true,
};
}