Table jumps up after data returned from the server
Table jumps up after data returned from the server
Hi Allan,
We are using force.com as our server so we can't your server side plugins.
We wrote Api layer a directive wrapping datatable that manipulate the information to/from the server and we use serverSide=false in the datatable options.
Doing all of this we still have a case where the datatable jumps to the start as if rerendered.
The "jump" happens when this callback is fired:
_fnCallbackFire( oSettings, 'aoDrawCallback', 'draw', [oSettings] );
Please tell me if there is some information from oSettings that can help you direct us to our mistake.
P.S. We do have one table which works with out the jump.
Thanks,
Yishay
Replies
What API method are you calling that triggers the "jump"? Are you drawing the table, or changing the data, or the paging, or something else?
Allan
Hi Allan,
function (method, url, data, successCallback, errorCallback)
Thanks,
Yishay
So its Editor's draw that is causing the jump? You can use the
drawType
option of theform-options
object to control the type of draw that Editor does when updating the table.Allan
Hi Allan,
thanks for the quick reply.
I tried
drawType: 'page'
anddrawType: 'none'
and none of them helped me.Any other ideas as to what we're doing wrong?
Thanks,
Yishay
Does the draw callback still get fires when you use
drawType: 'none'
? It shouldn't be!Allan
Hi Allan,
it enters
function _fnDraw( oSettings )
and thanbody.children().detach();
remove all the table andbody.append( $(anRows) );
draws it again.Thanks,
Yishay
Sure - but my point is, what is causing it to go into that in the first please. I know how the internal mechanics work, but I need to know what is triggering that draw.
Hi Allan,
it is triggered in the following path:
editorAjax -> successCallback (triggers the above functions)
editorAjax is the ajax attribute passed in the editor options to
new $.fn.dataTable.Editor
Thanks,
Yishay
With
drawType: 'none'
it simply shouldn't be callingdraw()
though. This is the code from Editor:Perhaps it would be worth putting a debug line or a breakpoint at that point in the code and check that your
drawType
is being used correctly.Allan
Hi Allan,
I don't have such a line in our dataTable.editor.js, maybe this feature doesn't work in our version?
Editor.version = "1.5.3";
this is the callstack:
(anonymous function) @ VM87428:1
evaluate @ (program):113
_fnDraw @ jquery.dataTables.js:2136
_fnReDraw @ jquery.dataTables.js:2191
(anonymous function) @ jquery.dataTables.js:7317
iterator @ jquery.dataTables.js:6902
(anonymous function) @ jquery.dataTables.js:7306
(anonymous function) @ jquery.dataTables.js:7065
commit @ dataTables.editor.js:5986
Editor._dataSource @ dataTables.editor.js:4293
(anonymous function) @ dataTables.editor.js:5101
(anonymous function) @ datatable.js:1798
processQueue @ angular.js:14991
(anonymous function) @ angular.js:15007
$eval @ angular.js:16251
$digest @ angular.js:16069
(anonymous function) @ angular.js:16290
completeOutstandingRequest @ angular.js:5729
(anonymous function) @ angular.js:6006
Thanks,
Yishay
That would do it. 1.5.6 is the current release.
Allan