beparnas
Forum Replies Created
-
Ok, so I spent some more time reading through the reference on dataTables, and this example is the closest I can find to what I intend to do, basically apply the
nonenames for the last two columns in my data. I assume this should be done in the JSON initialization object, something like:{ "responsive": true, "columns": [ { "data": "Category",className: "min-phone-l" }, { "data": "Item",className: "All" }, { "data": "Preview",className: "All" }, { "data": "In Stock? ",className: "desktop" }, { "data": "Price per item/unit",className: "min-phone-l" }, { "data": "Description", className: "none" }, { "data": "Quantity In stock",className: "none" } ] }However the
dataobject here is just from the example, I would need to use whatever is containing the data from the spreadsheet, correct? When I try to apply this to the plugin, it resets to the defaults. But does this look right otherwise?for reference, this is the data source.
Ok, yeah that seems like it would work. I would think that I could put in a width for “Desktop” that is less than infinity, say a value that forces the other columns to appear in the next rows, yeah? something like this:
$.fn.dataTable.Responsive.breakpoints = [ { name: 'desktop', width: <some#> }, { name: 'tablet-l', width: 1024 }, { name: 'tablet-p', width: 768 }, { name: 'mobile-l', width: 480 }, { name: 'mobile-p', width: 320 } ] $('#???IDK what goes here').DataTable( { responsive: true } );I’m not sure how to add this to the plugin however, the default settings show this:
{ "dom": "B<'clear'>lfrtip", "buttons": [ ] }would I just add it below the buttons tag? I’m not familiar with any of the syntax here :/ .