emptyTable not working

emptyTable not working

sebastian_acostasebastian_acosta Posts: 3Questions: 1Answers: 0

Link to test case: https://live.datatables.net/nenaqiwo/1/
Debugger code (debug.datatables.net):

tblSubCategorias

Data source: Ajax
Processing mode: Server-side
Draws: 1
Columns: 4
Rows - total: 0
Rows - after search: 0
Display start: 0
Display length: 10

Error messages shown: 16 tests complete. No failures or warnings found!
Description of problem:

Estoy haciendo un proyecto desde C# .net, en el cual utilizo para mi vista de html el datatable. Y es la primera vez que publico en este foro, por lo que desde ya pido disculpas sino envio toda la información requerida.
El resultado de Ajax no contiene entradas, pero Datatable no muestra el resultado de emptyTable sino el de loadingRecords.
El resultado del JSON es: {"draw":"1","recordsFiltered":0,"recordsTotal":0,"data":[]}

Answers

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951

    I am doing a project from C# .net, in which I use for my html view the datatable. And it is the first time I post in this forum, so I apologize if I don't send all the required information.
    The Ajax result does not contain entries, but Datatable does not show the emptyTable result but the loadingRecords result.

    The JSON response looks ok. If its stuck displaying the loading indicator then likely you are getting a Javascript error. Look at the browser's console for errors. Let us know what you find.

    Kevin

  • sebastian_acostasebastian_acosta Posts: 3Questions: 1Answers: 0

    The console is also empty. It only has warnings about other things I understand.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    "draw":"1"

    Could you change that to be an integer please? I'm not sure if that is the issue, but it doesn't expect the draw parameter to be a string - it should be an integer and I wonder if that is what is messing things up.

    Allan

  • sebastian_acostasebastian_acosta Posts: 3Questions: 1Answers: 0

    I don't know how to edit it to indicate a number, but I can say that when there are records it works fine as it is, as you can see in the image.![]

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951

    You have also defined the data option as "data": null,. Not sure if that is affecting the behavior but since its not being used I would remove it. Let us know if that helps.

    Kevin

Sign In or Register to comment.