65009074

Date: 2020-11-25 16:48:57
Score: 5.5
Natty:
Report link

@Gyrocode answer is correct. The reason @NasikAhd your are missing info/functionality is because of the .draw(). It is redrawing the page, so the options you have added in your code originally need to be added into the $(window).resize(function()). Make your page options you need as a function that can be called after every .draw().

@stijena, the select box remains the same because it has default settings (see: https://datatables.net/reference/option/lengthMenu ). You can change the default, the link has an example of doing so, but remember that when the page gets redrawn, the select box has to be redrawn as well.

NOTE I am having to use 'Answer' because 'add comment' wont let me use it as my reputation is 1. I know that it is recommended not to do this, but no one has addressed the comment questions. If someone comes here for the solution, they will encounter the same problems as the comment's additional questions, as is evident, since both comments are 6 months to 2 years after the accepted response. Please don't downvote this, or vote on it at all, just leave it at a zero. Thanks :)NOTE

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • RegEx Blacklisted phrase (1.5): reputation
  • Long answer (-1):
  • No code block (0.5):
  • Me too answer (2): the same problem
  • User mentioned (1): @Gyrocode
  • User mentioned (0): @NasikAhd
  • User mentioned (0): @stijena
  • Low reputation (1):
Posted by: Scott