How to create and publish GridWithSparkLine Control as a custom widget?
Note: We must bound the unique values column as a first column in the Column(s) section to plot the Sparkline based on the unique values, also the hierarchy should be followed as in the above image. If you are going to bind more columns to the widget, make sure the hierarchy is proper “Last level hierarchy data should be bound at first like first city and then country” as in the above image.
Making Improvements in GridWithSparkLine Custom Widget
Unpack the GridWithSparkLine Control custom widget (GridWithSparkLine Control .bicw) by following the steps in the mentioned link.
- Add the debugger to the sourcefile.js file's init() method. Also, add the needed changes in the sourcefile.js file.
Publish the custom widget by following the steps in this link.
Now, open the new dashboard in the Bold BI designer.
Open the Developer Tools in the Browser.
Drag and drop the GridWithSparkLine Control Custom Widget in the Designer.
Now, the debugger will trigger. Methods and use cases in the GridWithSparkLine Control source file.
The following table explains the use case of the methods available in sourcefile.js.
Methods
|
Use
case
|
init()
|
This
method will trigger when the GridWithSparkLine Control custom widget is
dragged and dropped in the designer or initialized in the viewer.
|
update()
|
This
method will trigger when the widget is resized, data is configured in the
widget, and when the changes are made in the property panel.
|
Related Links:
How
to create a new custom widget