[]
        
(Showing Draft Content)

GC.Spread.Sheets.TableSheet.BuiltInRowActions

Class: BuiltInRowActions

Sheets.TableSheet.BuiltInRowActions

Table of contents

Constructors

Properties

Constructors

constructor

new BuiltInRowActions()

Represent the table sheet built-in row actions.

Properties

dirtyStatus

Static dirtyStatus: IRowActionOptions

Represents the data changes in a row

property dirtyStatus - show the data changes in a row.

example

//When the data changed, the dirty status will show on the corresponding row in the TableSheet
var dataManager = spread.dataManager();
var myTable = dataManager.addTable("myTable", {
    autoSync:true,
    remote: {
        read: {
            url: 'https://demodata.mescius.io/northwind/api/v1/Orders'
        }
    }
});
myTable.fetch().then(function() {
    var myView = myTable.addView("myView");
    var tableSheet = spread.addSheetTab(1, "tableSheet1", GC.Spread.Sheets.SheetType.tableSheet);
    tableSheet.setDataView(myView);
    let sheet = spread.sheets[0];
    sheet.setRowCount(myTable.length() + 1);
    sheet.setColumnCount(Object.keys(myTable.columns).length + 1);
    sheet.tables.addFromDataSource("Table1", 0, 0, "myTable", GC.Spread.Sheets.Tables.TableThemes.dark1);
    sheet.setValue(1, 0, 'new value');
});

pinRow

Static pinRow: IRowActionOptions

Represents pin a row.

property pinRow - pin a row.

example

//When some rows pinned, the pin status will show
tableSheet.togglePinnedRows([1,2,4]);

removeRow

Static removeRow: IRowActionOptions

Represents remove a row.

property removeRow - remove a row.

example

let buildInRowActions = GC.Spread.Sheets.TableSheet.BuiltInRowActions;
let options = tableSheet.rowActionOptions();
tableSheet.rowActionOptions(options.concat([buildInRowActions.removeRow,buildInRowActions.saveRow,buildInRowActions.resetRow]));

resetRow

Static resetRow: IRowActionOptions

Represents reset the data change.

property resetRow - reset the data changes in a row.

example

let buildInRowActions = GC.Spread.Sheets.TableSheet.BuiltInRowActions;
let options = tableSheet.rowActionOptions();
tableSheet.rowActionOptions(options.concat([buildInRowActions.removeRow,buildInRowActions.saveRow,buildInRowActions.resetRow]));

saveRow

Static saveRow: IRowActionOptions

Represents save the data change in a row.

property saveRow - save the data changes in a row.

example

let buildInRowActions = GC.Spread.Sheets.TableSheet.BuiltInRowActions;
let options = tableSheet.rowActionOptions();
tableSheet.rowActionOptions(options.concat([buildInRowActions.removeRow,buildInRowActions.saveRow,buildInRowActions.resetRow]));

warningInfo

Static warningInfo: IRowActionOptions

Represents the text of warning info.

property warningInfo - show warning information in a row.

example

//When the remote request failed, the warning status will show on the corresponding row in the TableSheet
var dataManager = spread.dataManager();
var myTable = dataManager.addTable("myTable", {
    autoSync:true,
    remote: {
        read: {
            url: 'https://demodata.mescius.io/northwind/api/v1/Orders'
        },
        create: {
            url: 'https://invalidurl'
        }
    }
});
myTable.fetch().then(function() {
    var myView = myTable.addView("myView");
    var tableSheet = spread.addSheetTab(1, "tableSheet1", GC.Spread.Sheets.SheetType.tableSheet);
    tableSheet.setDataView(myView);
    tableSheet.addRow({id: 8, name: "spreadjs"});
});