Solved

Code to deselect first row in list view

  • 16 September 2020
  • 2 replies
  • 76 views

Badge +2

Hi All

 

Wonder if there any code gurus who could help on this request (or tell me if it's possible)

 

I'm using the script at the bottom of this post to automatiaclly select the first row of a list view (which is contained on a form).  This is so I can run the 'on click' event automatically without the user having to do anything.

 
However I'm now after some code to automatically deselect the first row (so a reverse)
 
Can anyone help?
Paul
 
================================================
<script>
$('div[name="PanelTitle"]').find($('td.first'))[0].click();
</script>
================================================
icon

Best answer by Mustafa 16 September 2020, 13:31

Hi,


 


Try this script


<script>
var contentTable = $('.grid').find('.grid-body-content');
$(contentTable).find("tr:eq(0)").removeClass('highlighted selected');
</script>
View original

2 replies

Userlevel 6
Badge +10

Hi,


 


Try this script


<script>
var contentTable = $('.grid').find('.grid-body-content');
$(contentTable).find("tr:eq(0)").removeClass('highlighted selected');
</script>
Badge +2

thanks Mustafa


Your code works perfectly - thanks

Paul

Reply