Home Community Uploads
image

Cireson Partners, Customers and Community members share your customizations and examples here to help benefit the community as a whole to earn Kudos and badges.

DISCLAIMER

All files and projects located here are provided and come "as-is" and without any warranty or support. Use at your own risk. Your use of Community Uploads is subject to our Terms of Use.

Cireson does not and will not support or maintain these enhancements, extensions, and scripts.

For Team Cireson uploads click here.

Reset the grids for all users when the portal is upgraded.

john_doylejohn_doyle Cireson Support Ninja IT Monkey ✭✭✭✭
When the portal is upgraded, sometimes the definition of the grids changes. As the portal caches the grid definitions in the local storage area of the browser, this can lead to unexpected results as the users continue to use the old definition until their browser refreshes the local storage or they click on Reset View. This has happened in the upgrade to V7.4 with users reporting that the date is shown with the time zone.

My solution to this is to record the current build version into the local storage and check it when the browser loads the portal. If the numbers do not match, the browser is instructed to clear the cached definitions for all the grids. The downside to it is that users will lose any filters or sorting that they had defined on the grids.

Here's the code:
$(document).ready(function () {<br>&nbsp;&nbsp;&nbsp; var gridReset = app.storage.gridStates.get('status_staticFileVersion');<br>&nbsp;&nbsp;&nbsp; if (!gridReset && gridReset != session.staticFileVersion)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; app.storage.gridStates.clearAll();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; app.storage.gridStates.set('status_staticFileVersion',session.staticFileVersion)<br>&nbsp;&nbsp;&nbsp; };<br>});



Comments

  • Martin_CoteMartin_Cote Customer IT Monkey ✭
    I wonder if there's a better way to fix this.  We just upgraded our environment from V5 to V7 and we do get the issue where the date in the grids is shown with the time zone (which make the view very difficult to read). 

    Doing the reset view manually, or running the script above just provide for a temporary fix, meaning that after a few minutes, the date is reverted to the long one (with the timezone and such) and have to reset the view again, which is not sustainable. 

    So instead of:
    7/14/2017 11:46 AM

    we get 

    Fri Jul 14 2017 11:46:15 GMT-0400 (Eastern Daylight Time)

    That's quite a lot of space used for nothing in a grid column.


  • Adrian_PaechAdrian_Paech Customer Advanced IT Monkey ✭✭✭
    Once you have reset it once for the grid affected, it should stay that way, but it must be reset once, per user, on each seperate page..
    hope this helps,
    adrian
  • Martin_CoteMartin_Cote Customer IT Monkey ✭
    Thanks for the feedback.  However that's what we did.  As I said, it looks fixed.  but then after a refresh of the page or going to another page and going back to the grid shows back the long date.  We did test on two specific users, and we did reset all the grids (manually on each page, and using the command line above in the console through the Debugger (F12)) but the result remain the same.  We have a lab with exactly the same customization files, and the lab doesn't present the same issue.  I also did try to remove any customization (empty the customspace folder) and no difference either.  I have an open ticket with Cireson, but if anybody else experienced similar behavior and have a good suggestion would be much appreciated.  thanks in advance.  
  • Adrian_PaechAdrian_Paech Customer Advanced IT Monkey ✭✭✭
    Hrmm haven't seen that one :-/ 
    hope you get it sorted...
    adrian
  • Ben_TeyBen_Tey Partner Adept IT Monkey ✭✭
    Just got a requirement from customer to display date under format "Fri Mar 16 2018 11:46:15 AM". Anyone have idea how to do this ?
  • Ben_TeyBen_Tey Partner Adept IT Monkey ✭✭
    Ben_Tey said:
    Just got a requirement from customer to display date under format "Fri Mar 16 2018 11:46:15 AM". Anyone have idea how to do this ?
    Let me re-phase the requirement.
    How do we display Long date format in Cireson Portal grid table ?
Sign In or Register to comment.