TabSheetModel.getObjectsJSON

Syntax

getObjectsJSON();

Description

The getObjectsJSON method returns table objects in the JSON format.

Comments

This method returns a JSON object with the following fields: H - object height, L - left margin, LC - column index of the cell, to which the object is pasted, OT - object type, T - top margin, TR - row index of the cell to which the object is pasted, U - object link URL, V - parameter indicating object visibility, W - object width.

Example

To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component), and the cell under coordinates (1, 1) must contain an icon as an object of the PP.Ui.TabSheetObject type named tabSheetObject (see the page with description of the TabSheet.addObject method). Get object URL and the cell that contains its top left corner:

// Get table model
var model = tabSheet.getModel();
// Get array of table objects in the JSON format
var objectsJSON = model.getObjectsJSON();
for (var i in objectsJSON) {
    var object = objectsJSON[i];
    console.log("Object address: " + object.U);
    console.log("Coordinates of object positioning: (" + object.TR + ", " + object.LC + ")")
};

After executing the example the browser console shows object URL and coordinates of the cell that contains its top left corner:

Object URL: img/home.png
Object position coordinate: (1, 1)

Seebsp;also:

TabSheetModel