Bootstrap 2 w/ Datatables 1.9 - Tweaks needed
Bootstrap 2 w/ Datatables 1.9 - Tweaks needed
rfitzwater
Posts: 57Questions: 5Answers: 1
All,
Looking for some help on a project I am tinkering with. I am using Bootstrap 2 for the layout and Datatables 1.9. I have things working okay right now, but I'd like to make some tweaks/fixes here and there. I'm hoping this community can help.
Here is a link to my test page: http://comm.rider.edu/datatable/mytest.html
Here are the problems/changes I need to make:
1. I am using some custom css to hide all checkboxes and replace them with a star graphic. This works for the items in the table that are displayed initially, but not all rows have this. I am assuming this is a DOM issue, but I'm not sure how to fix. Any ideas?
2. I am using the ColVis script to show/hide columns. I have the show/hide button moved to my Options modal window as I want to keep all options here. What I would like to know is if it is possible to have all the button/checkboxes to hide/show each column in a DIV as opposed to having to click the show hide button and then select which ones you want to show and hide. I'm sure it is possible, but I'm looking for advice on how to best accomplish this.
3. My table has a lot of data, based on what you can see from the source, is there a better/more efficient way I should be configuring things? I would like this to be as fast as possible when done.
As always thanks to Allan for the great work on this script and thanks to the community for the assistance provided!
-Rhon
Looking for some help on a project I am tinkering with. I am using Bootstrap 2 for the layout and Datatables 1.9. I have things working okay right now, but I'd like to make some tweaks/fixes here and there. I'm hoping this community can help.
Here is a link to my test page: http://comm.rider.edu/datatable/mytest.html
Here are the problems/changes I need to make:
1. I am using some custom css to hide all checkboxes and replace them with a star graphic. This works for the items in the table that are displayed initially, but not all rows have this. I am assuming this is a DOM issue, but I'm not sure how to fix. Any ideas?
2. I am using the ColVis script to show/hide columns. I have the show/hide button moved to my Options modal window as I want to keep all options here. What I would like to know is if it is possible to have all the button/checkboxes to hide/show each column in a DIV as opposed to having to click the show hide button and then select which ones you want to show and hide. I'm sure it is possible, but I'm looking for advice on how to best accomplish this.
3. My table has a lot of data, based on what you can see from the source, is there a better/more efficient way I should be configuring things? I would like this to be as fast as possible when done.
As always thanks to Allan for the great work on this script and thanks to the community for the assistance provided!
-Rhon
This discussion has been closed.
Replies
I presume that there is some Javascript involved in this somewhere? Just a guess since you say that the elements on the initial page work, and the others don't. You either need to use fnGetNodes or the $ API method to operate on all nodes in the paged table, or initialise that Javascript before you do DataTables. See: http://datatables.net/faqs#events
> 2. [...] What I would like to know is if it is possible to have all the button/checkboxes to hide/show each column in a DIV as opposed to having to click the show hide button and then select which ones you want to show and hide
There isn't a built in way in ColVis to do that, but ColVis is simply a wrapper around the fnSetColumnVis API method for DataTables. So all you have to do is create the interface as you want and then attach Javascript handlers that will call the API method to show / hide columns.
> 3. My table has a lot of data, based on what you can see from the source
Actually I'm getting errors when loading the page at the moment so I can't see what is going on I'm afraid. Is it Ajax loading data? Enable the bDeferRender option if you are using Ajax loading with paging to get a real speed boost :-)
Allan
[/quote]
Nope, its just CSS.
[quote]Actually I'm getting errors when loading the page at the moment so I can't see what is going on I'm afraid. Is it Ajax loading data? Enable the bDeferRender option if you are using Ajax loading with paging to get a real speed boost :-)[/quote]
Adding the bDeferRender is what is causing that JS error. I removed it so you don't get that error any more. Take a look now if you can. And yes I am using AJAX for loading data.
The LABEL tag is coming from the server in the JSON, so I guess that not all the data for the cells is being generated as needed there.
Allan
Dumb on my end. My php script that was generating the json file was missing the addition of the label attribute for the second group of data I was pulling. Fixed and now all rows have the star.
[quote]Actually I'm getting errors when loading the page at the moment so I can't see what is going on I'm afraid. Is it Ajax loading data? Enable the bDeferRender option if you are using Ajax loading with paging to get a real speed boost :-)[/quote]
Do you have any idea why my table would be getting the error you saw when I add the bDeferRender option?
Allan
So any suggestions on how to get this working so my page/data loads faster. If not using bDeferRender, is there other things I can do to make things work better? I'm going to be recommending users that have IE be at version 9. That should help, but overall speed improvement would be great!
Allan