Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Disable Sort links on Browse Form Headers?

Post Reply
jegalink
Posts: 16
Joined: Mon Feb 09, 2015 6:17 pm

Disable Sort links on Browse Form Headers?

Unread post by jegalink »

I'm wondering if there's some simple JavaScript that could do this (i don't know Javascript at all). I want to disable the sort links at the header of each column in the browse form. I'm using WITH ROLLUP in the GROUP BY clause of the SQL statement, so ORDER BY will return an error from MySQL (since the two are mutually exclusive). So if they click any of the header names, the link produces an error since it adds "ORDER BY" to my query.
jegalink
Posts: 16
Joined: Mon Feb 09, 2015 6:17 pm

Re: Disable Sort links on Browse Form Headers?

Unread post by jegalink »

OK, so I KNOW this isn't the most elegant solution, but it works. I'm a php & sql hack, no javascripting background. I placed the following into Custom Code --> Javascript for the Browse form in question. The table of results in this case has five columns, so the following disabled the link at the header of all five columns, but kept the text:

Code: Select all

    document.getElementById('nusort_1').style.pointerEvents = 'none';
    document.getElementById('nusort_2').style.pointerEvents = 'none';
    document.getElementById('nusort_3').style.pointerEvents = 'none';
    document.getElementById('nusort_4').style.pointerEvents = 'none';
    document.getElementById('nusort_5').style.pointerEvents = 'none';
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Disable Sort links on Browse Form Headers?

Unread post by admin »

jegalink,

Try this...

Code: Select all

$("[id^='nusort']").attr('onclick','');
Steven
Post Reply