What Files To Download?
What Files To Download?
I have created a table (http://siskgratings.com/test/products_lightduty.html) and I am trying to add a text box where the user can input a number in order to sort the table. The table should sort by column 2 "Recommended Max. Span...." For example if a user inputs 76" the results should show all "bearing bar size" that have a max span of ( =/+ ) the user's entered data. This site is built using boostrap 3.3.6. Also, this site is still under construction. I am hoping that someone could help me to find out if this can be accomplished using this plugin and if/what DataTable Plug-ins will be required found @ https://www.datatables.net/download/index. Thank you, in advance for your help, cheers.
Answers
Unfortunately DataTables doesn't support colspan / rowspan in the
tbody, so I'm afraid the table that your page shows is not one that would be supported by DataTables.For example, if you click to sort by
48", what should happen to the grouping? If you filter to "0.372" again what happens to the grouping. That unfortunately isn't trivial, so I'm afraid it isn't supported.Allan
So if I were to get rid of the rowspan/colspan in the tbody and made them a list in a single cell....would it then sort the table using a text box?
An example of something close to what I am trying to achieve can be found @ http://www.nucorgrating.com/products/stainless-steel-grating/imperial/
I'm not sure what you mean by sorting a text box. But yes, without the colspan / rowspan, DataTables should be quite able to sort your table. Give it a try :-)
Ok, that's great but what should I download from the download builder on https://www.datatables.net/download/index?
I would suggest just starting with DataTables core. Do you need any of the extensions?
This is what I have built:
Main Libraries:
jQuery-no
Styling-Bootstrap | no styling library
(I didn't include these because I already have jQuery 1.11.3 and bootstrap 3.3.6)
DataTables-DataTables
Extensions:
Buttons-Print View
FixedHeader
Responsive
Packaging Options:
minify
local files
Is this package correct or do I need to change/add anything? Sorry for all the questions. I want to make sure I am not leaving anything out while keeping the files to a minimum.
If that suits your requirements then it is correct. I'm afraid I don't know what your requirements are, so I can't say.
Its easy to change if you decide you want something else in future.