'Stop running script' message in browser
'Stop running script' message in browser
I am using 1.4.3 version. I am rendering 10000 entries using data-table. The browser ( both Firefox 3.0.10 and IE 7) is generating error message 'stop running script - a script on this page is causing Internet explorer to run slowly. If it continues to run, your computer may become unresponsive'.
I am using these options for the data-table:
$(document).ready(function() {
$('#table').dataTable( {
"bProcessing": true,
"iDisplayLength": 50,
"aaSorting": [[0,'asc']]
//"bSort": false,
});
Can anybody suggest a solution?
Otherwise, I am pretty impressed by the simplicity and number of features available. It is really a marvelous job by Allan!
I am using these options for the data-table:
$(document).ready(function() {
$('#table').dataTable( {
"bProcessing": true,
"iDisplayLength": 50,
"aaSorting": [[0,'asc']]
//"bSort": false,
});
Can anybody suggest a solution?
Otherwise, I am pretty impressed by the simplicity and number of features available. It is really a marvelous job by Allan!
This discussion has been closed.
Replies
Thanks for your kind words! The reason for the slow script error is that DataTables needs to do a LOT of processing for 10'000 records. There are a few things you can do to speed things up though:
- disable sorting column classes with bSortClasses ( http://datatables.net/usage#bSortClasses )
- disable (or optimise) sorting
But probably your best bet for this many records would be to use DataTables 1.5's sever-side processing option (assuming that this viable for you). That way all the processing will be done lightning fast on the server-side.
Hope this helps,
Allan
Thanks once again.
For server side processing, I downloaded Datatables 1.5 beta version. I am having some problems. Here is my html:
{% block title %}{% endblock %}
$(document).ready(function() {
$('#table').dataTable( {
"aoColumns":[{"sTitle":"Engine"},{"sTitle":"Browser"},{"sTitle":"Platform"}],
"bProcessing": true,
"bServerSide": true,
"bAutoWidth": true,
"bSort":false,
"sAjaxSource": "/servicemap/ajax_data"
});
} );
{%block content_title%}
{% endblock %}
On the server side, I am able to generate JSON string in my Django code:
{"iTotalRecords": 3, "aaData": [["Trident", "Internet Explorer 4.0", "Win 95+"], ["Trident", "Internet Explorer 5.0", "Win 95+"], ["Trident", "Internet Explorer 5.5", "Win 95+"]], "iTotalDisplayRecords": 3}
Now, this needs to be linked to a JQuery function. How to do this? It may be simple. But, I am not able to figure it out. I have gone through the example of server side scripting code at http://www.datatables.net/examples/example_ajax_source.html and other examples. You are passing iDisplayStart and iDisplayLength.
Any help is appreciated.
Allan
Thanks,
Matthew