SpreadJS製品ヘルプ
all メソッド
GC.Spread.Sheets.FloatingObjects 名前空間 > FloatingObjectCollection タイプ : all メソッド
シートに存在するすべてのフローティングオブジェクトを取得します。
シンタックス
var instance = new GC.Spread.Sheets.FloatingObjects.FloatingObjectCollection(sheet, typeName);
var value; // Type: any
value = instance.all();
function all() : any;
使用例
次のサンプルコードは、allメソッドを使用します。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 20, 20, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button1";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);

var customFloatingObject1 = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f2", 5, 5, 30, 64);
var btn1 = document.createElement('button');
btn1.style.width = "60px";
btn1.style.height = "30px";
btn1.innerText = "button2";
customFloatingObject1.content(btn1);
activeSheet.floatingObjects.add(customFloatingObject1);

var floating = activeSheet.floatingObjects.all();
for(var i = 0; i < floating.length; i++){
alert(floating[i].name());
}
activeSheet.pictures.add("p1", "pics/download.jpg", 1, 6, 400, 400);
activeSheet.pictures.add("p2", "pics/download.jpg", 500, 150, 200, 300);
var pictures = activeSheet.pictures.all();
for (var i = 0; i < pictures.length; i++) {
    alert("Path of picture " + i + " is:  " + pictures[i].src())
}
関連トピック

参照

FloatingObjectCollection タイプ