-
-
Save moxet/7e27a359785c8fcf05d80877115e6a94 to your computer and use it in GitHub Desktop.
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.11.2/datatables.min.css"/> | |
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.11.2/datatables.min.js"></script> | |
<script> | |
jQuery(document).ready(function($) { | |
$('.jet-dynamic-table').DataTable(); | |
}); | |
</script> |
Hi, thanks for this. Really helpful.
I'm using JetEngine Tables builder to display CPT repeater fields data. Seems that I can't automatically order columns.
Is it possible to force a column in a specific order with these snippets ? I did try with Default ordering (sorting) but can't make this work. Thanks
@alexgauvin i guess i replied in youtube, you need to pass flat/raw data to datatable instead of template.
@moxet Thanks, I wasn't sure you would respond on YT. Everything's working as expected.
Thank you for your assistance. Issue resolved.
Hello, whats Is the Solution?
@Jonathan1500 Here's my snippet, if it can help :
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.11.2/datatables.min.css"/>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.11.2/datatables.min.js"></script>
<script>
jQuery(document).ready(function($) {
$('.jet-dynamic-table').DataTable( {
order: [[0, 'desc']],
info: false,
paging: false,
searching: false
});
});
</script>
With it, you can display or not some elements on the table.
And, with the order param, you can point which column will be automatically filtered and in what order.
@Jonathan1500 Here's my snippet, if it can help :
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.11.2/datatables.min.css"/> <script type="text/javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.11.2/datatables.min.js"></script> <script> jQuery(document).ready(function($) { $('.jet-dynamic-table').DataTable( { order: [[0, 'desc']], info: false, paging: false, searching: false }); }); </script>
With it, you can display or not some elements on the table. And, with the order param, you can point which column will be automatically filtered and in what order.
You table Is with crocoblock?
Data is created with JetEngin CPT, with a custom repeater field.
Data is then displayed with Tables builder provided by JetEngine as an addon plugin.
But I wasn't able to filter repeater data. With @moxet's tutorials i'm good to go.
Data is created with JetEngin CPT, with a custom repeater field. Data is then displayed with Tables builder provided by JetEngine as an addon plugin. But I wasn't able to filter repeater data. With @moxet's tutorials i'm good to go.
I use the same jetengine and table builder, but I have a problem that only shows me 10 post
Data is created with JetEngin CPT, with a custom repeater field. Data is then displayed with Tables builder provided by JetEngine as an addon plugin. But I wasn't able to filter repeater data. With @moxet's tutorials i'm good to go.
I use the same jetengine and table builder, but I have a problem that only shows me 10 post
check your query if you put offset that limiting to 10
Hello, i dont have limit in my query
Thank you for your assistance. Issue resolved.