Multiple server-side calls on data tables initialization

Multiple server-side calls on data tables initialization

vdavidoffvdavidoff Posts: 3Questions: 0Answers: 0
edited October 2011 in DataTables 1.8
Hi,

I'm just getting started with data tables. So far things are going pretty smoothly, but I am experiencing some behavior that concerns me. I don't think that I'm doing anything that would be causing this, but I'm not sure, and I can't find anything about it in the forums.

I am using server side processing and on initial page load (data tables initialization) I see our server side script get called 3 times. I don't see any reason it should be called more than once. I have a button on the same page that triggers a call with fnDraw when it's clicked, and that works fine any only generates 1 server side request. Same with sorting - sorting a column generates one server side request and works fine.

My initialization is using sAjaxSource to talk to our server side script, and I am using fnServerData to send form data along with the call.

What can I do to make the initial page draw only call our server side script once?

Thanks.
Andy

Replies

  • vdavidoffvdavidoff Posts: 3Questions: 0Answers: 0
    I found one of the extraneous server side calls. We're using FixedColumns which, at a glance, hides the column it fixes then redraws it on its own. Setting bVisible to false for that column made the columns visibility agree with FixedColumn's fnSetColumnVis() call (passing bShow as false) and avoided that extraneous server side call. Still working on the other. Have leads but nothing I'm certain about yet.
  • vdavidoffvdavidoff Posts: 3Questions: 0Answers: 0
    I have traced the other 2 server-side calls to _fnAjaxUpdateDraw and _fnSort. I believe the one in _fnAjaxUpdateDraw (called by _fnAjaxUpdate) is the only one I want running, and is called when my sAjaxSource is processed. The only way I see to disable the one called in _fnSort is to set bSort to false, but I don't want to totally disable sorting.

    Does this sound right? Is there just no way to avoid the extra/unnecessary server-side call if I want sorting enabled?
This discussion has been closed.