Browser Reload (F5 key)

Browser Reload (F5 key)

plcplc Posts: 22Questions: 4Answers: 0

Weirdly, the datatable initially renders perfectly, but if the user then clicks F5, the column widths all then appear to change, the table expands outside of its bootstrap container and a horizontal scrollbar appears at the bottom of the screen.

Pressing F5 again restores the initial (correct) view. Continuing to press F5 looks to 'toggle' this effect, correct - incorrect - correct - incorrect etc.

I initially put this down to Chrome, but it's happening in IE too. I've compared the HTML from an 'correct' render and also from an 'incorrect' render and (viewstate handlers aside), they're both identical.

Has anybody witnessed behaviour like this?

I've attempted to remedy it by adding table.columns.adjust().draw(); after the table is drawn, but it appears to make no difference.

Many Thanks.

Answers

  • allanallan Posts: 63,519Questions: 1Answers: 10,473 Site admin

    Can you link to a test page showing the issue please. I'm not seeming that in my example pages.

    Allan

  • plcplc Posts: 22Questions: 4Answers: 0

    Hi Allan,

    I'll look to get something set up on the server. Thanks.

  • plcplc Posts: 22Questions: 4Answers: 0

    Hi Allan,

    I'm still working on getting this uploaded - however, I've noticed that the problem looks to go away if I remove the line:-

    stateSave: true

    so it looks like 'statesave' is the culprit. I really need to save the page number the user is currently on so that they can return to that same page if they attempt to edit a record but subsequently cancel. I don't want to return them to page #1.

    Is there anything specific in the statesave code which might affect the browser F5 functionality?

  • allanallan Posts: 63,519Questions: 1Answers: 10,473 Site admin

    Not as far as I am aware. F5 appears to work as expect in my state saving demo.

    Allan

  • plcplc Posts: 22Questions: 4Answers: 0

    Thanks, Allan.

    My DT also uses Responsive, so I'm wondering whether it's the combination of StateSave AND Responsive, which leads to the problem?

    I'm having difficulty accessing our server currently but as soon as I'm able, I'll set up a demo demonstrating the problem with StateSave both ENABLED and DISABLED.

  • allanallan Posts: 63,519Questions: 1Answers: 10,473 Site admin

    Doesn't appear to be: http://live.datatables.net/yezumowa/1/edit .

    Are you seeing any errors on the console?

    Allan

  • plcplc Posts: 22Questions: 4Answers: 0

    Your test page looks completely stable.

    I'm not seeing any console errors, nor any differences in the generated HTML. It's really odd - it's literally a complete toggle effect - one time it works, after F5 it breaks the container, then it works, then it breaks the container..

    I'm still going to try to get something set up on the server, though this might be tomorrow now before I'm able to get this set up.

    Thanks for your help so far.

  • allanallan Posts: 63,519Questions: 1Answers: 10,473 Site admin

    I haven't really been any help thus far! Hopefully we'll get it figured out with a reproducible test case though :-).

    The only thing off the top of my head would be to try the nightly versions (like in my demo) if you aren't already.

    Allan

  • plcplc Posts: 22Questions: 4Answers: 0

    Thanks, Allan - I'll give those a go in the meantime.

This discussion has been closed.