Skip to main content

Grid

A sub namespace of UI, exclusive for grid operations

//accessing to ui.grid methodsSW.UI.Grid.{methodName}

addToolbarButtons#

Description#

This method can be to add buttons in the grid toolbar.

Method(s)#

1 function addToolbarButtons(toolbarEvent: any, buttonsList: Button[]): void;
ParameterTypeRequiredDefaultsDescription
toolbarEventanytrueThe target dataGrid
buttonsListButtontrueButtons to add

Basic Usage#

SW.UI.Grid.addToolbarButtons(toolbarEvent, buttonsList);

calculatePercentageSummary#

Description#

This method can be used to calculate summaries with percentages.

Method(s)#

1 function calculatePercentageSummary(options: any, dividend: number[], divisor: number[]): void
ParameterTypeRequiredDefaultsDescription
optionsanytrueSummary options
dividendnumber[]trueArray of dividends
divisornumber[]trueArray of divisors

Basic Usage#

SW.UI.Grid.calculatePercentageSummary(options, [1,2,3], [4,5,6]);

Response#


delete#

Description#

This method can be used to delete grid rows.

Method(s)#

1 function delete(documentName: string, dataGrid: dxDataGrid, params: { idField?: string } = {}): void 
ParameterTypeRequiredDefaultsDescription
documentNamestringtrueDocument name
dataGriddxDataGridtrueTarget datagrid
idFieldstringfalseField to delete

Basic Usage#

SW.UI.Grid.delete("company", dataGrid);

expandCollapseRows#

Description#

This method can be used inside any workspace. To expand or collapse specified Grid rows.

Method(s)#

1   function expandCollapseRows(dataGrid: dxDataGrid,2       params: { 3           expandPriority?: boolean 4       } = { 5           expandPriority: true 6       }7   ): void 
ParameterTypeRequiredDefaultsDescription
dataGriddxDataGridtrueTarget datagrid
expandPrioritybooleanfalsetrueFlag to set if the rows are to expanded or collapsed instead

Basic Usage#

SW.UI.grid.expandCollapseRow(dataGrid.component);

Response#


importExcel#

Description#

This method can be used to import a xlsx file into a datagrid.

Method(s)#

1 function importExcel(fileUpload: any, grid: dxDataGrid): void;
ParameterTypeRequiredDefaultsDescription
fileUploadanytrueFile to be uploaded
dataGriddxDataGridtrueTarget datagrid

Basic Usage#

SW.UI.grid.importExcel(file, grid);