And before we start,I want you to see my final result. If you like it, then go ahead and I will explain, how you can achieve that.
These are the main features of the so-called widget, which you will get in the end:
- It is completely self-contained – after you create it, the only thing you need is to add the view on the form, where you would like to have that widget.
- It notifies the user about new tasks – by default, the color of the appearing panel is the same as the view header, i.e. it depends on the theme. And it turns red when the worklist is refreshed and some new tasks appear there.
So let’s move to implementation.
1. Add a worklist on the view.
First of all, you need to create a view and add a worklist there. I would also recommend to show only 1 column on that worklist. Otherwise, your users will have to scroll to see all other columns. In my case I added a worklist with 1 column Folio. Also, you need to configure a Refresh Interval, if you want the slider to turn red, when you have tasks.
2. Add JS and CSS onto the view.
- CSS – Apply Styles – here I will add my CSS styles;
This is the code, which i used for the demo:
3. Simply add the view to some form and test.
As I have already mentioned, the only thing you need is to add the view on the form, where you would like to have a k2 slide in worklist. The view contains all the logic and will load everything automatically.
I have not tested a K2 slide in worklist with all possible screen resolutions, therefore, feel free to use it, change it and, if needed, ask questions about anything.
I have create a separate repo on GitHub, where I will try to collect all such nice K2 features. you can find it under K2Devs.