User Review
( votes)Introduction
Recently we were working on a PCF dataset control that can be configured on the Home grid as well as on the subgrid. So while developing the control there were few queries such as what data can we get from the context object regarding the Subgrid. For example, the Subgird label, View ID, Relationship Name for which the Subgird is configured, whether the auto-expand property is true or not, etc.
For finding out I used my developer tool and then used it to check the information that we get in the context for the dataset.
In ‘context.navigation._customControlProperties’ we get all the information regarding the Subgird as shown in the below screenshot.
In ‘context.navigation._customControlProperties.descriptor’ you will get to know some useful information which you can use for control like
Apart from the above-mentioned information, you can get many more details like whether the auto-expand is enabled which can be used for control styling, etc.
You can know whether the control is configured on the Home grid or subgrid by following this blog.
Conclusion
Thus, as explained above, we can get additional information regarding the subgrid using the context object provided by the PCF control.