Creating custom widgets
You create a custom widget by dragging the Custom () icon onto a cell in a page. Click the top row of the widget and click Edit (). A sidebar opens with the properties for this widget. The following properties are available.
- Show widget frame
- Specify whether the widget frame, which has a title bar with minimize and maximize icons, should be displayed.
- Show border
- Specify whether the widget frame should have a visible border. Only available if Show widget frame is selected.
- Provide a widget title shown on the title bar. If empty, the widget's title bar is not displayed. Only available if Show widget frame is selected.
Click Edit code to add the code for this widget. The Edit Code view has three panes.
- This pane previews the output of the widget.
- This pane has the following settings.
- Render HTML automatically
- Specify whether the HTML template should be rendered automatically. You may want to deselect
this option and use the
startRender()method to control rendering.
- Send click events for ranking
- Specify whether to send a click event every time a document is selected from a document list.
- Listen to search results
- Specify whether the widget should listen to a specific data source changes. If checked,
onDeselect()callback methods are called when the data source state changes.
- Perform search on data source
- Specify whether the widget should search on specific data sources. If selected, you can choose
data sources to search. The
search()API performs a search on the data sources specified by this option.
- This pane has five tabs.
- You can edit HTML code here.
- You can edit CSS code here.
- You can edit sample data for previewing the widget here.
- This tab contains sample code. Click one of the names at the top of the code to view the code for that sample. You can copy sample code into your own code. Select the code you want and click Apply.