dspolyglot Posted October 24, 2017 Report Share Posted October 24, 2017 Hello everyone, Does anyone have a workaround for providing a "No sort" option to gallery or list DataPages? It seems like Caspio does not provide it out-of-the-box. I have a gut feeling that it can be done via JavaScript, but I'm not sure how it can be done. Thanks in advance for the help. -dspolyglot Quote Link to comment Share on other sites More sharing options...
nightowl Posted October 24, 2017 Report Share Posted October 24, 2017 HI dspolyglot, I tried this a long time ago and I was able to create a workaround. You can try the following and see if this still works: Add a Header/Footer section to your Gallery/List DataPage. Go to the Footer section. On the footer section's Advanced tab, disable the HTML editor as mentioned in this article: http://howto.caspio.com/faq/web-forms/how-to-disable-html-editor-in-datapage-headerfooter-and-html-blocks/ Then add this code: <script> var sortingControl = document.getElementById('asorting'); sortingControl.innerHTML += '<option value="|">No Sort</option>'; </script> [OPTIONAL] Then go to Search and Report Wizard - Results Page Options and disable AJAX: Hope this helps. -nightowl Quote Link to comment Share on other sites More sharing options...
Alwayslost Posted October 25, 2017 Report Share Posted October 25, 2017 This is awesome. Is there a way for the code to be the first option in the dropdown menu vs last option? Thanks in advance Quote Link to comment Share on other sites More sharing options...
nightowl Posted October 25, 2017 Report Share Posted October 25, 2017 Hi Alwayslost, Yes. We only need to change the second line of the script. Here's the fully revised script: <script> var sortingControl = document.getElementById('asorting'); sortingControl.innerHTML = '<option value="|">No Sort</option>' + sortingControl.innerHTML; </script> Hope this helps. -nightowl Quote Link to comment Share on other sites More sharing options...
Alwayslost Posted October 25, 2017 Report Share Posted October 25, 2017 Thank you for the respond.. When I add it to my listing datapage, I get it to respond: (image attached) It doesn't matter if I have on top of the sorting or bottom either. BUT.. It shows it twice for some reason under the sorting options. Any ideas why? I have it under footer with HTML disabled before the Mobile responsive code and tried it after as well. And AJAX is disabled under sorting... Still shows it twice. Thanks a bunch upfront Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.