Configuration of DataTable in PUG (Jade)
Configuration of DataTable in PUG (Jade)
Ragin
Posts: 6Questions: 1Answers: 0
Hi,
I am using the dataTables by specifiying them in a Jade-Template this way:
.table-responsive.mt-2
data-table(:rows="orderItems", :sort-by-column="2", :filtering="false")
Now I need to allow ordering only for column 2.
I know this should be done using orderable and target, but I really cannot get i working..
Anyone there who can show me the correct way?
Ragin
This discussion has been closed.
Answers
data-table(:rows="orderItems", :sort-by-column="2", :columnDefs: "[targets: [1,2], orderable: false }]"
this crashes my complete template...
Don't know anything about PUG but it looks like you are missing a
{
between[
andtargets
to open the object definition. Maybe you are missing the closing)
. Something like this maybe:data-table(:rows="orderItems", :sort-by-column="2", :columnDefs: "[{targets: [1,2], orderable: false }]")
Kevin
Hi Kevin,
you were right. I corrected this but still all my columns are orderable.
:ordering= "true", :columns= "[{orderable: true} , {orderable: true} , null, null, null, null, null, null }]",
tried this. but then also the jade precompiler crashes...
solved it now using javascript to re-initialize that table...
that works now...