Page 1 of 1

Disable Sort links on Browse Form Headers?

Posted: Thu Sep 15, 2016 2:52 am
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.

Re: Disable Sort links on Browse Form Headers?

Posted: Thu Sep 15, 2016 12:20 pm
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';

Re: Disable Sort links on Browse Form Headers?

Posted: Tue Sep 27, 2016 3:50 am
by admin
jegalink,

Try this...

Code: Select all

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