fnSettings().oScroller.fnMeasure() causing inaccurate length

fnSettings().oScroller.fnMeasure() causing inaccurate length

rsmithrsmith Posts: 5Questions: 1Answers: 0
edited August 2015 in Free community support

I'm not sure if this is a bug but since there seems to be a preference to use this forum, I post the information here.

I'm using DataTables with the scroller plugin (which is a great, by the way) with server-side processing enabled. I found that after resizing the container in which DataTables is operating, I have the need of calling fnAdjustColumnSizing() and fnSettings().oScroller.fnMeasure() to update the columns width and the text at the bottom showing the number of entries displayed. That works okay, but unfortunately it has a negative effect on the length that is passed in the ajax call. Here you can find the debug information ( http://debug.datatables.net/ogohaj ) but the main issue is that after changing the container, the next call has parameters that look like this:

start:0
length:126
search[value]:
search[regex]:false
nrows:100.

It says that there are 126 rows, but actually, there are only 100 rows. This causes unintended behavior after fetching the next set of rows. nrows is being used only to tell the server how many rows there are available and this is passed as a recordsTotal parameter to the client.

If I remove the fnSettings().oScroller.fnMeasure() then the computation is correct (although, of course, the text at the bottom is not updated). Is this a bug?

Thanks.

Answers

  • allanallan Posts: 63,704Questions: 1Answers: 10,502 Site admin

    Hi,

    Could you link to the page so I can to debug and resolve the issue please.

    Allan

  • rsmithrsmith Posts: 5Questions: 1Answers: 0
    edited August 2015

    No problem. I'm not sure why the debug page expired. Let me try again.

    UPDATE: Oh, it didn't expire. The parenthesis on the right was modifying the link. I already correct it.

  • allanallan Posts: 63,704Questions: 1Answers: 10,502 Site admin

    I'm afraid a debug link won't help too much in this case. I will need to be able to use the page so I can see what is happening and when.

    Allan

  • rsmithrsmith Posts: 5Questions: 1Answers: 0

    Uhm. That is going to be hard. It is an application being developed in localhost. Let me see if I can reproduce the problem in a fiddle.

  • rsmithrsmith Posts: 5Questions: 1Answers: 0

    I think a client-side implementation is not going to be enough to reproduce this issue. Are you comfortable if I share the code for server-side processing using Tornado? That's my preference.

  • allanallan Posts: 63,704Questions: 1Answers: 10,502 Site admin

    What is Tornado?

  • rsmithrsmith Posts: 5Questions: 1Answers: 0

    It is a Python framework. Do you have a Python environment available (Flask, Django, Bottle)?

  • allanallan Posts: 63,704Questions: 1Answers: 10,502 Site admin

    No sorry - not at this time.

    Allan

This discussion has been closed.