question

Upvotes
Accepted
791 10 10 16

'api' property on Grid element

Please explain why isn't 'api' property available on a Grid element?

api#technology#product
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Upvotes
Accepted
61 1 0 1

Since Grid is a custom element, grid element is not defined immediately after the page load. The `api` property will only be available after the element is defined and configured. So, set a method on the `whenDefined` property in the configuration object to handle custom task after the initialization. `whenDefined` method will guaranteed availability of the `api` property on a grid element.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.