Solved

How to select a row in a list view

  • 6 November 2017
  • 3 replies
  • 16 views

Badge

Is there a possibilty to select a row in list view programmatically (via rule or javascript code), so that the item click event will be fired? E.g. select the row with id = 1234.

One thing to mention: a "list item click"-method exists for a view, but there a no input mappings for it. So, what is it good for?

 

icon

Best answer by Mustafa 14 December 2017, 17:36

Hi,



 



Yes, you can use the following script to select a row and trigger list item click event:



 



$(".grid-body-content-wrapper tbody tr").each(function(index)

{



var itemType ;

itemType = JSON.parse($(this).find("td").eq(0).attr("data-options"));



if(itemType.value=="ListItemID")

{



$(this).addClass("highlighted selected");

$(this).click();

}

})





List item click is an event, you can use it to execute a set of actions (i.e open subview, transfer data...etc)

View original

3 replies

Userlevel 6
Badge +10

Hi,


 


Yes, you can use the following script to select a row and trigger list item click event:


 


$(".grid-body-content-wrapper tbody tr").each(function(index)
{

var itemType ;
itemType = JSON.parse($(this).find("td").eq(0).attr("data-options"));

if(itemType.value=="ListItemID")
{

$(this).addClass("highlighted selected");
$(this).click();
}
})


List item click is an event, you can use it to execute a set of actions (i.e open subview, transfer data...etc)

Userlevel 3
Badge +13
How do you apply this script?

Do you add a data label and click literal and then transfer the script over?

If my list view has 3 items, how can i get it to go to row 2?

Thanks

Hi Sharpharp1,
did you solve that issue already? I have the same need and it appears I am missing something. I want to select the line item the user has clicked before the list was refreshed and updated. Many thanks!

Reply