draw is egal null

draw is egal null

MasingaMasinga Posts: 12Questions: 2Answers: 0

Hello everyone,
I am stuck on datatable by the search customize columns with the select. everything works, except that the give does not refresh and does not change anything, in the post draw I receive null or 0.

with the select search it's ajax on the initComplet function, and I get the data from the backend. that the console but nothing happens. help

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    in the post draw I receive null or 0

    That would be a problem in the server script not updaing the draw parameter properly. Are you using a server side processing script provided by Datatables?

    Kevin

  • MasingaMasinga Posts: 12Questions: 2Answers: 0

    thank you in advance,
    I receive 0 then I made a condition if it is null to put 0 . and on my table I have well and truly serverside on true.

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    As far as I know the client side will never send draw: 0 when server side processing is enabled. It starts with 1 and increments for each request. Can you post a link to your page or a test case showing the issue so we can help debug?

    Use the browser's network inspector tool to see what is being sent.

    Kevin

  • MasingaMasinga Posts: 12Questions: 2Answers: 0
    edited November 2022


    Hi, I'm sending you some screenshots of my custom select and the backend and ajax that sends the request to the backend


  • MasingaMasinga Posts: 12Questions: 2Answers: 0

    how to activate draw on ajax of my function initComplete. as ja' customize the columns. thanks

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945
    edited November 2022 Answer ✓

    The ajax request you have in initComplete is using jQuery ajax() not Datatable's ajax option. So its not going to send a draw parameter. You won't be able to update the Datatables table this way. See some options below.

    Are the select options to be used as column searches? If yes, maybe something like this example will work better as it uses column().search() and will send the search terms as described in this server side processing protocol doc.

    Are the select options for searching data outside of the columns? If yes then try using -optoin ajax.data as a function, like this example. In the select change event handler call ajax.reload() to refresh the data.

    Kevin

  • MasingaMasinga Posts: 12Questions: 2Answers: 0

    thank you very much
    I want to search on all data in the database. I have a question how can I make my selects a search column, please I don't understand the part, if you could see the capture on the nes selects. I am a junior developer, I can't understand your solution. the problem is how can I make the selects option in Datatable search column?
    please example code

  • MasingaMasinga Posts: 12Questions: 2Answers: 0

    Hi Kevin ,
    Please help me sincerely, I really don't know how to make the value of my , select as Datatable search input. It has been three days of work, but still no solution, I try everything.

  • rf1234rf1234 Posts: 2,982Questions: 87Answers: 421
    Answer ✓

    @Masinga
    I am trying to understand what you are saying. Unsuccessfully so.

    Could you summarize what your problem is in your own language and use a translator to translate it into English? That might help!
    This is a good translator: https://www.deepl.com/translator

    Could you link to a page showing the issue? Or make a test case?

    Roland

  • MasingaMasinga Posts: 12Questions: 2Answers: 0

    Hello Roland,
    thank you very much, I finally found a solution.
    In the future, I will make your recommendation.

    Thank you, have a good weekend.

Sign In or Register to comment.