Multiple request with fnReloadAjax with fnDrawCallback
Multiple request with fnReloadAjax with fnDrawCallback
Hello.
Firstly, thank you Allan for the superb job you've done with DataTables.
My problem is the following, I have two datatables (oTable, sTable). sTable is inside JQuery UI Dialog.
When user clicks a row on sTable, it should close the dialog and populate oTable with data.
Everything is working fine except if user decides to sort columns on sTable before clicking a row. This causes multiple fnReloadAjax-calls (excally as many times as user has sorted sTable). Log after five sorts and then clicking a row:
[code]
2010-11-19 13:54:22,796 INFO xxxDAO:269 - QueryImpl(xxx...
2010-11-19 13:54:22,843 INFO xxxDAO:269 - QueryImpl(xxx...
2010-11-19 13:54:22,890 INFO xxxDAO:269 - QueryImpl(xxx...
2010-11-19 13:54:22,921 INFO xxxDAO:269 - QueryImpl(xxx...
2010-11-19 13:54:22,953 INFO xxxDAO:269 - QueryImpl(xxx...
[/code]
I'm using fnDrawCallback on sTable. I think this is causing the problem. Code:
[code]
"fnDrawCallback": function () {
$(this.fnGetNodes(this.search)).click(function () {
var position = sTable.fnGetPosition(this);
var nTds = $('td', this);
nTds.addClass('highlighted');
var queryString = $('#statisticsform').formSerialize();
oTable.fnReloadAjax('servlet/xxxServlet.ajax?mode=xxx&fxxx='+sTable.fnGetData(position)[6]+'&'+queryString);
$('#statistics').dialog('close');
});
},
[/code]
Does anyone have any ideas how to solve this problem?
Thanks,
- Flexo
Firstly, thank you Allan for the superb job you've done with DataTables.
My problem is the following, I have two datatables (oTable, sTable). sTable is inside JQuery UI Dialog.
When user clicks a row on sTable, it should close the dialog and populate oTable with data.
Everything is working fine except if user decides to sort columns on sTable before clicking a row. This causes multiple fnReloadAjax-calls (excally as many times as user has sorted sTable). Log after five sorts and then clicking a row:
[code]
2010-11-19 13:54:22,796 INFO xxxDAO:269 - QueryImpl(xxx...
2010-11-19 13:54:22,843 INFO xxxDAO:269 - QueryImpl(xxx...
2010-11-19 13:54:22,890 INFO xxxDAO:269 - QueryImpl(xxx...
2010-11-19 13:54:22,921 INFO xxxDAO:269 - QueryImpl(xxx...
2010-11-19 13:54:22,953 INFO xxxDAO:269 - QueryImpl(xxx...
[/code]
I'm using fnDrawCallback on sTable. I think this is causing the problem. Code:
[code]
"fnDrawCallback": function () {
$(this.fnGetNodes(this.search)).click(function () {
var position = sTable.fnGetPosition(this);
var nTds = $('td', this);
nTds.addClass('highlighted');
var queryString = $('#statisticsform').formSerialize();
oTable.fnReloadAjax('servlet/xxxServlet.ajax?mode=xxx&fxxx='+sTable.fnGetData(position)[6]+'&'+queryString);
$('#statistics').dialog('close');
});
},
[/code]
Does anyone have any ideas how to solve this problem?
Thanks,
- Flexo
This discussion has been closed.