Processing message when sorting

Processing message when sorting

lenamtllenamtl Posts: 261Questions: 64Answers: 1
edited August 3 in Free community support

Hi,

I have updated from 1.10 to the latest.
I'm using Bootstrap 5 and this happening in client side
How to reproduce click on column sorting icon.

On 1.10 I was not seeing the processing message (maybe only when there was a lot of data).
Now I always see processing message even when only a few result for example if I sort 6 records / client side.

This is anoying because it just flickering .

Is there a way to only display when there is a lot of data?

Thanks

Answers

  • allanallan Posts: 56,819Questions: 1Answers: 9,029 Site admin

    Can you link to a test case showing the issue please? With only 6 rows, I wouldn't expect the processing disable to be painted by the browser.

    Allan

  • lenamtllenamtl Posts: 261Questions: 64Answers: 1
    edited August 4

    Hi,

    I cannot reproduce the case on JSFiddle with plain HTML JS.
    I don't know what trigger this...
    This problem was not present on 1.10

    The message display even for 2 rows or on empty table when I click on sort....

    I'm using PHP, I'm saving statesave to DB using Ajax.
    I only change the Datatables package and I use the latest jQuery.

    Can you point me in the code where it is set and the condition that displayed it.

  • lenamtllenamtl Posts: 261Questions: 64Answers: 1

    By the way, how can I set to false using default
    Because this is not working

        $.extend( $.fn.dataTable.defaults, {  
        "processing": false,
          }
    

    I may disabled this message as a temporary solution.

  • kthorngrenkthorngren Posts: 16,747Questions: 25Answers: 3,966
    edited August 5

    According to the processing the default is false. Do you have processing: true set in the Datatable init code?, If yes then this will override your setting for the defaults.

    Kevin

  • lenamtllenamtl Posts: 261Questions: 64Answers: 1

    I only have **bprocessing ** for the button is it the same?

  • kthorngrenkthorngren Posts: 16,747Questions: 25Answers: 3,966

    I'm not sure what bprocessing for the button does. I don't remember seeing this as a buttons option. If you can't post a test case showing the issue please post your relevant JS code. If you have processing: false or don't have the processing configured then it will be turned off. But if you are still seeing a processing message then maybe you have custom code showing processing.

    Kevin

  • lenamtllenamtl Posts: 261Questions: 64Answers: 1
    edited August 8

    Hi,

    I tought that bProcessing was for the buttons because of the b but in fact this is the old syntax for the Processing message.

    See https://legacy.datatables.net/ref#bProcessing

    I have replaced bProcessing by Processing and now the message is not appering all the time.
    I will need to test with a lot of data to see if the message will appear in this case.

    I would like to understand what are the condition that trigger the message.

  • lenamtllenamtl Posts: 261Questions: 64Answers: 1
    edited August 8

    Also

    Should I use processing or Processing?
    If I use processing = the problem persist
    If I use Processing = no message

    So I need to know a way to check if this is ok or not...

  • kthorngrenkthorngren Posts: 16,747Questions: 25Answers: 3,966

    Take a look at the legacy options conversion guide for details. All the DT 1.10 options can be found here

    Use processing not Processing. Processing won't be found and will silently be ignored.

    Kevin

  • lenamtllenamtl Posts: 261Questions: 64Answers: 1
    edited August 8

    When I checked at https://datatables.net/reference/option/processing
    I found a user comment that point to the r use into the DOM that is also trigger the
    processing message

    So If I understand correctly, having these 2 can cause an issue because of the r into the DOM

    "processing":true,
    "dom": 'Bfrtip',
    
  • lenamtllenamtl Posts: 261Questions: 64Answers: 1
    edited August 8

    I'm confused
    https://datatables.net/reference/option/dom

    there are 2 r options on this page
    one for processing and one for reorder...

    So the r from this code is it for reorder or processing:

     dom: '<"row"<"col-md-6 col-sm-12 col-xs-12 "B><"col-md-6 col-sm-12 col-xs-12">>' +
                '<"row"<"col-sm-6"l><"col-sm-6"f>>' +
                '<"row"<"col-sm-12"tr>>' +
                 '<"row"<"col-sm-5"i><"col-sm-7"p>>',
    

    I would like to see a case where the r is use for processing...

  • kthorngrenkthorngren Posts: 16,747Questions: 25Answers: 3,966

    The comment states this:

    The letter 'r' represents the processing indicator so if it's not showing, that could be missing.

    The default dom has this lfrtip including r. The comment says that if you specify the dom option then maybe the r is missing in the string so it needs to be added to display the processing message.

    I'm assuming you are not using server side processing, ie, you don't have serverSide: true. Here is a 57 row table with BS 5 and processing: true. The processing indicator is not seen when sorting.
    http://live.datatables.net/sogurodi/1/edit

    Here is a similar example with 50,000 rows. The processing indicator is briefly seen - but not for 2 seconds..
    http://live.datatables.net/todunoze/1/edit

    There must be some process happening on your page to cause this to happen even with 2 rows. Please post a link to your page or a test case replicating the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • lenamtllenamtl Posts: 261Questions: 64Answers: 1

    I just want to make sure does adding the r into the lfrtip is the same as
    processing: true or the r is just required to display the message if true?

  • kthorngrenkthorngren Posts: 16,747Questions: 25Answers: 3,966
    edited August 8

    The dom option tells Datatables where to place the elements around the table. It does not enable the display of the processing element. Setting processing true enables the display of the processing element. If you use the dom option to display the buttons, B for example,, then you also need to haver` if you want to see the processing element.

    So yes both r and processing: true need to be in place to see the processing message.

    here are 2 r options on this page
    one for processing and one for reorder...

    Javascript is a case sensitive language. The processing option uses lower case r and the colReorder option uses upper case R. These are different.

    So the r from this code is it for reorder or processing:

    <"row"<"col-sm-12"tr>> is lower case r so its for processing.

    Kevin

  • lenamtllenamtl Posts: 261Questions: 64Answers: 1

    Ok thanks for the infos, I will continue the tests until I find the culprit..

Sign In or Register to comment.