How do I get access to oSettings if I want to replace the default callback function in AJAX ?
How do I get access to oSettings if I want to replace the default callback function in AJAX ?
genmoltek
Posts: 4Questions: 0Answers: 0
I hope someone can point me in the right direction.
I just KNOW the answer is probably built into DataTables 1.9X already ..
but I can't see the Trees for the Forrest. :/
I saw the following post regarding 'Script is running too long' Issue on IE 8 (which I am unfortunately forced to use.)
http://datatables.net/forums/discussion/16655/ie8-a-script-on-this-page-is-causing-your-web-browser-to-run-slowly/p1
The code in that discussion thread appears to be using Interval and breaking the JSON returned from Ajax into more manageable chunks.
My problem is the Script is taking too long when CREATING the Table.
I have under 40k records and the AJAX call returns in under a second.
Question #1) Is that solution in the link above only for Tables that have already been drawn ? The name of that function leads me to think that it is for Updating but not useful for creating/initializing.
If the Answer to #1 is 'Yes', then I assume I have to take bits of the default callback and bits from the link above in order to create/initialize a table with Data that won't trigger the 'Script is Running too long' issue.
"If" that assumption is true, then that leads me to my last and most important Question:
Question #2) If I need access to the 'oSettings' object (which is used in the default callback) then should my own custom function use the 'this' pointer to gain access to the 'fnSettings' function ? Per Discussion Post: http://www.datatables.net/beta/1.8/examples/api/api_in_init.html
I just KNOW the answer is probably built into DataTables 1.9X already ..
but I can't see the Trees for the Forrest. :/
I saw the following post regarding 'Script is running too long' Issue on IE 8 (which I am unfortunately forced to use.)
http://datatables.net/forums/discussion/16655/ie8-a-script-on-this-page-is-causing-your-web-browser-to-run-slowly/p1
The code in that discussion thread appears to be using Interval and breaking the JSON returned from Ajax into more manageable chunks.
My problem is the Script is taking too long when CREATING the Table.
I have under 40k records and the AJAX call returns in under a second.
Question #1) Is that solution in the link above only for Tables that have already been drawn ? The name of that function leads me to think that it is for Updating but not useful for creating/initializing.
If the Answer to #1 is 'Yes', then I assume I have to take bits of the default callback and bits from the link above in order to create/initialize a table with Data that won't trigger the 'Script is Running too long' issue.
"If" that assumption is true, then that leads me to my last and most important Question:
Question #2) If I need access to the 'oSettings' object (which is used in the default callback) then should my own custom function use the 'this' pointer to gain access to the 'fnSettings' function ? Per Discussion Post: http://www.datatables.net/beta/1.8/examples/api/api_in_init.html
This discussion has been closed.
Replies
I would like to setup the example with Ajax.
But I dont know of any Source / URL value that the 'live' site supports.
Was hoping that maybe one of the Ajax Tutorial/Examples would work but no luck (yet).
Any suggestions are appreciated.
So, regarding question 2 - what you could do, is provide your own fnServerData call. Then make your Ajax request, and in the success function, chunk the data as you need. If the first chunk of the DataTables callback and then add the other chunks using fnAddData .
However, before you do that - try dropping in DataTables 1.10 and make sure you have bDeferRender enabled . 1.10 has one change that will make a major impact on performance, particularly in old IE, and a lot of other little performance changes.
Allan
It's good to know that at least I am on the right track.
I am restudying JavaScript Closures.. and the old cobwebs are starting to clear out -- a bit.
Is there a sample Ajax call that works with the live datatables site ?
Allan
I would love to switch over to the 10.x Beta, but I will not be able to do that just yet.
I keep getting 403 Forbidden Error even with a simple php reference.
http://live.datatables.net/boqifob/26/edit?html,css,js,console,output
This is by NO means to be considered a complaint !
I just want to make sure I understand what is possible with the current 'Live' site that supports the 9.x version of DataTables...
Interested to hear how you get on with 1.10 if you do take the plunge.
Allan