I need to call 'fnDraw' to get the table formatted

I need to call 'fnDraw' to get the table formatted

lwoodslwoods Posts: 11Questions: 0Answers: 0
edited February 2011 in General
I am displaying a table in a jQuery dialog. It displays but is not formatted correctly. Headers/Footers not lined up; no "up/down" arrows; and the word "Search" is off to the right while the textbox is in the middle of the area. I added a "click" item and executed a 'table.fnDraw();' method. Everything lines up and all is well. This definitely looks like the table software isn't finding the css files BUT the table is "pretty much" formatted before the "fnDraw" which says that at least SOME of the css is being seen. For example, the rows background color alternates.
So, I need to know how to force the table software to recognize all of the css (assuming that is the problem) or I need to know how to automatically force a table redraw when the dialog opens. And, "No," executing fnDraw immediately after the instatiation of the table doesn't do it.

????????????????????????/

Replies

  • allanallan Posts: 63,400Questions: 1Answers: 10,452 Site admin
    Can you link us to an example showing the problem please? I'm not sure what would be causing that. Are you initialising the table when it is hidden? If so you'll need to call http://datatables.net/api#fnAdjustColumnSizing .

    Allan
  • lwoodslwoods Posts: 11Questions: 0Answers: 0
    Well, your suggestion to add the fnAdjustColumnSizing cleaned up most of the problem. In the examples below ALL of the code is on the page so you can use "View Source" to see what I have done.
    Click the URL below, then click on "Load Dialog". All looks well except the Search text and textbox. Ideas?

    http://63.226.10.37/probdoc/test_dialog_2.php

    Now, before you try the next URL---in IE---be prepared to cancel the browser because when you click "Load Dialog" you will see the browser go "wild"---at least that has been my experience. The difference between the two URL's is that in the following URL I have removed two "local" css files that were for other formatting. Therefore the following URL is ONLY DataTable stuff---and jQuery. Very strange.

    http://63.226.10.37/probdoc/test_dialog_22.php

    All ideas are welcome.

    TIA
  • lwoodslwoods Posts: 11Questions: 0Answers: 0
    During another test I have discovered what is happening with the browser. I set up the window.bind.resize to call fnAdjustColumnSizing. The problem is that this causes a loop and the table width grows forever. So, I put a counter in the bind so that it wouldn't call fnAdjustColumnSizing more than 2 times. Now things look list test_dialog2 above BUT I still have screwed up Search text and textbox.

    Ideas?
This discussion has been closed.