ColumnControl - custom content
ColumnControl - custom content

Does anyone have a simple example of a columnControl custom content widget. I've got the basics in place to create the button which does what I want (toggle rowgrouping on various fields), but I can't figure out how to integrate that into the dropdown menu's neatly.
The docs say that I can extend 'Button', but I can't see how I do that in the custom content code?
Answers
Your best bet here is to take a look at the code for one of the existing buttons. For example this is for
orderAsc
.Worth noting as well that I plan to have a row grouping button in ColumnControl 1.1 which I hope will be out at the end of the month.
Allan
I looked at one of those, but couldn't figure out how to convert the
new Button(dt)
to JS
Right - engaged brain and I think I've got it sorted
That is JS
. That class is available under
DataTable.ColumnControl.Button
and can be instantiated from there. This might be a good one for a blog post sometime... Thanks for bringing this up!Allan
Yeah I realized that was my mistake - I needed to get it from the Datatable.ColumnControl module
One further question - is there an equivalent of autoClose:true for the columnControl menus?
And fwiw - knowing its not the most elegant code, but it works and someone might find inspiration...
Not at the moment I'm afraid. However, you can call
._close()
on thediv.dtcc-dropdown
element. That is a custom method that is added to the dropdown elements and will close all of them.Allan
I think that code look good btw!
I've been working on ColumnControl 1.1 features recently, which includes a new
rowGroup
button and this is my attempt at it. There are also buttons for adding and removing subgroups and clearing all.Allan
Is there a timeline for when ColumnControl 1.1 will be available, either as a nightly or as a full release? I was looking for that exact additional functionality when I came across this thread.
I'd love to not reinvent the wheel if it's already invented. If it won't be for a while, that's fine, I'd just like to know when that might be.
Hopefully tomorrow, all being well
.
Allan