Jump to content
dspolyglot

Option for disabling sorting in Gallery DataPages

Recommended Posts

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

Share this post


Link to post
Share on other sites

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:

  1. Add a Header/Footer section to your Gallery/List DataPage.
  2. Go to the Footer section.
  3. 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/
  4. Then add this code:
  5. <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:

  6. 59ef91a76925e_DisableAJAX.png.3747c55d9350124d8fe83c9098891a85.png

Hope this helps.

-nightowl

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Untitled.png

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...