Using dataTables in Ajax JQuery Tabs

Using dataTables in Ajax JQuery Tabs

nutless_neonutless_neo Posts: 13Questions: 0Answers: 0
edited April 2012 in DataTables 1.9
I am having trouble with getting the datatables to show up in my tabs. I'm using a very simple tab function from jquerytools.org. separately my dataTables and tabs work beautifully, but if i put them on the same page (i.e. the dataTables inside the tabs) - the dataTables don't show up - just the tabs.

Replies

  • nutless_neonutless_neo Posts: 13Questions: 0Answers: 0
    Update: I was able to get a datatable to show up in my second tab, but it's still not showing up in my first tab. But in the second tab datatable, none of the datatable features are working, such as pagination, re-ordering, etc.
  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Does it work without the tabs? If so, then it might be an idea to ask the tabs authors how to access DOM elements inside the tabs.

    Allan
  • nutless_neonutless_neo Posts: 13Questions: 0Answers: 0
    Yes it works without the tabs - I actually switched over to Jquery UI tabs, since you made your datatables work with the UI theming, I figured it would work with the tabs, but I am still having some trouble getting it work completely.
  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Can you link me to a test case showing the problem please?

    Allan
  • nutless_neonutless_neo Posts: 13Questions: 0Answers: 0
    In this link, you can see the datatables working properly:
    http://michael.benefitharbor.com/dev/Employer/invoices/mde/unum-lmh.htm

    but in this link, where they are called into the tabs, they don't work:
    http://michael.benefitharbor.com/dev/Employer/JqueryScrollingTabs.htm
  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Have you add a look at the web-browser's console? You've got a JS error (TypeError: 'undefined' is not a function (evaluating '$("#switcher").themeswitcher()')) and a whole bunch of 404 errors, including jQuery (which looks like it is being loaded about 5 times) and DataTables - which probably explains why it isn't working on that page :-)

    Allan
  • nutless_neonutless_neo Posts: 13Questions: 0Answers: 0
    Okay, i am seeing the same errors in Firebug, but I don't understand why, because I have checked and double checked and the paths are correct and the files are there. I even used an absolute URL to the files and still get the same 404 errors - that is strange.
  • nutless_neonutless_neo Posts: 13Questions: 0Answers: 0
    Okay, here is something interesting. I was able to get the ColReorder to work, if, I put the datatable into the parent page. But it won't work if I'm calling it remotely, like before. I'm using the exact same scripts, css, data, etc.
  • nutless_neonutless_neo Posts: 13Questions: 0Answers: 0
    Allan, I'm sorry for asking so much of you - your tool is truly wonderful, unfortunately, I am just a designer and no programmer, so I am needing more than most in getting this to work to my needs. Please look at the example in the link (under the LMH tab) and see the issues I am having, such as the spacing and the other Datatables not working properly like the first one is.

    Thank you in advance.

    http://michael.benefitharbor.com/dev/Employer/JqueryScrollingTabs.htm
This discussion has been closed.