Is there a way to filter a table by table headers in frameless output? It's more like how filters work in Excel, not like sorting the table content alphabetically or in a specific order.
Thanks.
Is there a way to filter a table by table headers
Re: Is there a way to filter a table by table headers
There's nothing like that built-in to Flare.
I'd strongly recommend looking at the brilliant Datatables plugin: https://www.datatables.net/
We use it in one of our projects for filtering and sorting a massive table (see here).
I'd strongly recommend looking at the brilliant Datatables plugin: https://www.datatables.net/
We use it in one of our projects for filtering and sorting a massive table (see here).
Re: Is there a way to filter a table by table headers
Very nice indeed!
I never got it to Datatables work due to conflicts with require.js and whatnot, so I wrote my own javascript table filter (sorting was not required). I found it easier to write my own than to work out how to get around require.js.
-Niels
I never got it to Datatables work due to conflicts with require.js and whatnot, so I wrote my own javascript table filter (sorting was not required). I found it easier to write my own than to work out how to get around require.js.
-Niels
-----
Flaring in Copenhagen, Denmark
Flaring in Copenhagen, Denmark
Re: Is there a way to filter a table by table headers
Yeah, it took me a while to work out RequireJS - to initialise it, I run a script like this.nielsf wrote:Very nice indeed!
I never got it to Datatables work due to conflicts with require.js and whatnot, so I wrote my own javascript table filter (sorting was not required). I found it easier to write my own than to work out how to get around require.js. :roll:
-Niels
You'd need to change
- baseUrl path : relative path from topic to datatables js file in your project
- jquery path : relative path from topic to Flare's copy of jquery in the output
Code: Select all
/* Set jquery path to Flare's installed version */
require.config({
baseUrl: "../Resources/datatables/js/",
paths: {
"datatables": "jquery.dataTables.min",
"jquery": "../../../../Resources/Scripts/jquery.min"
}
});
requirejs(["jquery", "datatables" ], function() {
/* requirejs - include all script dependencies */
$(document).ready(function() {
/* - MUST Be 'DataTable' (case sensitive) */
var mytable = $('#your-table').DataTable({
/* your datatable configuration options go here */
});
});
});
-
- Propeller Head
- Posts: 68
- Joined: Fri Aug 22, 2014 12:24 pm
Re: Is there a way to filter a table by table headers
Dave, that's been my problem with RequireJS. I have different topics at different ToC depths that all need access to my RequireJS enabled jQuery plugins. One relative path isn't sufficient for all my topics. I haven't been able to figure out a way around that. I tried just hosting another copy of jQuery 1.8.3 on my site so it was an absolute path for all my files, but then it became a second imported jQuery file and you know how that goes.
Any ideas?
Any ideas?
Re: Is there a way to filter a table by table headers
I've no ideas, other than if you're happy using an absolute path, could that not just be to the jQuery included by Flare?Mike Kelley wrote:Dave, that's been my problem with RequireJS. I have different topics at different ToC depths that all need access to my RequireJS enabled jQuery plugins. One relative path isn't sufficient for all my topics. I haven't been able to figure out a way around that. I tried just hosting another copy of jQuery 1.8.3 on my site so it was an absolute path for all my files, but then it became a second imported jQuery file and you know how that goes.
Any ideas?
Or if you have two versions of jQuery, that shouldn't be an issue provided they're configured in RequireJS.
I don't know RequireJS very well, and figuring it out this far took me ages!
Re: Is there a way to filter a table by table headers
You can put an array of alternative paths in your path configuration. I think the intention is to allow you to fall back to a local script if a remote script is unavailable, but I've used this to include paths from topics at different depths. I don't know if there is a limit on the number of fallback paths you can provide.
See paths config fallbacks in the RequireJS docs.
J
Code: Select all
paths: {
fiddledeedee: path,
blah: [path1, path2]
}
J
-
- Jr. Propeller Head
- Posts: 1
- Joined: Fri Jul 28, 2017 1:43 pm
Help with Datatables
I am totally new to datatables and jquery. I would like to make my simple HTML table filterable. I have tried to follow the steps described in the datatables manual, but I am finding no success. Any help is appreciated.
Re: Help with Datatables
You need to initialise the datatables plugin using RequireJS - see the previous posts in this thread.zmtuabanna wrote:I am totally new to datatables and jquery. I would like to make my simple HTML table filterable. I have tried to follow the steps described in the datatables manual, but I am finding no success. Any help is appreciated.
That's how I got datatables to work - I can't offer any more help than I've already posted here.