Making RPC calls to the server
Sooner or later, your widget will need to look up some data from the server. In this recipe, we will add a tooltip on the color pill. When the user hovers their cursor over the color pill element, the tooltip will show the number of books related to that color. We will make an RPC call to the server to fetch a book count of the data associated with that particular color.
Getting ready
For this recipe, we will be using the my_library
module from the previous recipe.
How to do it...
Perform the following steps to make an RPC call to the server and display the result in a tooltip:
- Add the
willStart
method and setcolorGroupData
in the RPC call:willStart: function () { var self = this; this.colorGroupData = {}; var colorDataPromise = this._rpc({ ...