SpreadJS製品ヘルプ
setDataSource メソッド
GC.Spread.Sheets 名前空間 > Worksheet タイプ : setDataSource メソッド
データソース。
シートがリセットされる場合はtrue、それ以外の場合はfalse
シートにデータを供給するデータソースを設定します。
シンタックス
var instance = new GC.Spread.Sheets.Worksheet(name);
var value; // Type: any
value = instance.setDataSource(data, reset);
function setDataSource( 
   data : Object,
   reset : boolean
) : any;

パラメータ

data
データソース。
reset
シートがリセットされる場合はtrue、それ以外の場合はfalse
使用例
This example automatically sets the data types for the cells when binding the sheet.
var activeSheet = spread.getActiveSheet();

var people = [
    {name: "Albert", isAdult: false, country: "American", website: "albert.com"},
    {name: "Alice", isAdult: true, country: "China", website: "alice.com"},
    {name: "Bob", isAdult: false, country: "Canada", website: "bob.com"}
];

activeSheet.setDataSource(people);
This example sets a data source for the sheet.
var activeSheet = spread.getActiveSheet();

var test = [
       { "Series0": 2, "Series1": 1 },
       { "Series0": 4, "Series1": 2 },
       { "Series0": 3, "Series1": 4 }
            ];
activeSheet.autoGenerateColumns = true;
activeSheet.setDataSource(test, true);
This example automatically sets the data types for the cells when binding the sheet.
var activeSheet = spread.getActiveSheet();

var people = [
    {name: "Albert", isAdult: false, country: "American", website: "albert.com"},
    {name: "Alice", isAdult: true, country: "China", website: "alice.com"},
    {name: "Bob", isAdult: false, country: "Canada", website: "bob.com"}
];

activeSheet.setDataSource(people);
This example sets a data source for the sheet.
var activeSheet = spread.getActiveSheet();

var test = [
       { "Series0": 2, "Series1": 1 },
       { "Series0": 4, "Series1": 2 },
       { "Series0": 3, "Series1": 4 }
            ];
activeSheet.autoGenerateColumns = true;
activeSheet.setDataSource(test, true);
関連トピック

参照

Worksheet タイプ