As per title: How can one create a hidden column to store data that should not be shown directly?
@thomasmoors the visible property when defining columns.
private function getColumns()
{
return [
'store_id' => ['name' => 'store_id', 'data' => 'store_id', 'visible' => false],
];
}
Unless ypu want to show that column later, itd be better to just put it as a row attribute using datatable defcolumns
I can give you an example when i get on my computer.
EDIT: I misread the question, this is for rows, not columns.
Woof, I meant createdrow not columndefs
so inside you JS datatable() definition you put something like
createdRow: function( row, data, dataIndex ) {
$(row).attr({
"first-attribute": data["firstValue"],
"second-attribute": data["secondValue"],
});
},
and so on
Obviously the attributes and values I wrote are placeholders.
you can find more info here
And don't forget that the datatable documnetation applies to this plugin
And then you just casually $([rowSelector]).attr('first-attribute); when you need what's inside
Thanks for the answers guys! I think this is resolved. 馃憤
Most helpful comment
Thanks for the answers guys! I think this is resolved. 馃憤