SpreadJS 13
GC.Spread.Sheets.FloatingObjects Namespace / FloatingObjectCollection type / all Method
In This Topic
    all Method
    In This Topic
    Gets all of the floating objects in the sheet.
    Syntax
    var instance = new GC.Spread.Sheets.FloatingObjects.FloatingObjectCollection(sheet, typeName);
    var value; // Type: any
    value = instance.all();
    function all() : any;
    Example
    This example uses the all method.
    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())
    }
    See Also