[]
        
(Showing Draft Content)

Bind Cells

You can use cell-level binding in SpreadJS.


Cell-level binding binds an object's property to a sheet cell. Wrap the data object to GC.Spread.Sheets.Bindings.CellBindingSource before binding the cell. Then bind the wrapped source to the sheet (sheet.setDataSource).


The following code sample binds cells in the sheet.

var person = {name: "Wang feng", age: 25, address: {postcode: "710075"}};
var source = new GC.Spread.Sheets.Bindings.CellBindingSource(person);
activeSheet.setBindingPath(0, 0, "name");
activeSheet.setBindingPath(1, 1, "age");
activeSheet.setBindingPath(3, 3, "address.postcode");
activeSheet.setDataSource(source);