getTabImagesJSON();
The getTabImagesJSON method gets the array of icons in the table tabs in the JSON format.
This method returns a JSON object with the TabObjectImage field, that is an array of icon objects.
To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component).
Add an image encoded as base64 before parameters of "Structure" into the Expanders.js file:
"TabObjectsImages": { "TabObjectImage": [ { "@I": 1, // Object identifier "asImage": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZ..."// Base64 of object } ] }
Execute the following in the console:
// Create a new table object var tabSheetObject = new PP.Ui.TabSheetObject({ Data: { "@I": 1, // Object identifier "@TR": 1, // Cell row index, to which area object is inserted "@LC": 1, // Cell column index, to which object is inserted "@T": 14, // Top padding "@L": 5, // Left padding "@H": 51, // Object height "@W": 56 // Object width }, Parent: tabSheet }); // Add object to table tabSheet.addObject(tabSheetObject); // Get table model var model = tabSheet.getModel(); // Display array of objects console.log(model.getTabImagesJSON()); };
After executing the example the console displays the array of existing objects with identifiers and encoding base64.
Seebsp;also: