Setting the text/language for the colvis column list
Setting the text/language for the colvis column list
It's possible there is something in the documentation for this, but I can't seem to find it, if so.
I'm defining one of my columns to display as an icon in the table but different in the searchBuilder, like so:
{
"data": "experiment_ids",
"name": "experiment_ids",
"title": '<i class="fa fa-flask"></i>',
"searchBuilderTitle": 'Has Experiment',
"searchBuilderType": "string",
"className": "idwiz_searchBuilder_enabled",
"type": "bool",
"render": function(data, type) {
if (type === 'display') {
return data ? '<i class="fa fa-flask"></i>' : '';
}
if (type === 'filter') {
return !data ? 'True' : 'False';
}
return data;
},
"searchBuilder": {
"orthogonal": {
"search": "filter",
"display": "filter",
}
}
},
This works pretty well (although I can't seem to edit the filter types, I think because I'm on server-side?).
But, the last hurtle I'm facing is getting the column to show correctly in the ColVis dropdown. Currently, the select option shows blank with this setup.
Anyone know of a way to achieve that?
This question has an accepted answers - jump to answer
Answers
I did finally find the piece of documentation I was looking for and was able to do this to alter the button text for 2 of my columns:
But, it doesn't work with col re-order because it relies on column index. Is there any other way to ID the columns in the columnText callback so the colvis settings "stick" to them when re-ordered?
Try using
colReorder.transpose()
. Something like this might work:Kevin
Flipping amazing, works like a charm, thank you!