Skip to main content
Nintex Community Menu Bar
Solved

De-Select List item(s) via script

  • October 31, 2017
  • 2 replies
  • 6 views
  • Translate

Forum|alt.badge.img+8

Hi All

 

Does anybody have any code which could be used to de-select an item(s)  from a smartform list view

In the project I'm building a user will select an item or items from a list view but then I need to be able to delect those items if some conditions are not met.

 

I cant see any out of the box options in K2 to do this so wondering if some script could be used?

 

Any help much appreciated

 

Paul

Best answer by Albarghouthy

Hi Paul,


 


The following script will de-select all the selected items:


 


 


 $(".grid-body-content-wrapper tbody tr").each(function(index)
{
$(this).attr('class', '');
})

Not sure if you looking for something more specific, if you have the list item ID and you want to de-select this specifc item, you can try the following:


 


$(".grid-body-content-wrapper tbody tr").each(function(index)
{
try
{
var itemType ;
itemType = JSON.parse($(this).find("td").eq(0).attr("data-options"));

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

$(this).attr('class', '');
}
}
catch(err)
{}
})

Hope that helps

View original
Did this topic help you find an answer to your question?

2 replies

Albarghouthy
Forum|alt.badge.img+16
  • Scholar
  • 741 replies
  • Answer
  • October 31, 2017

Hi Paul,


 


The following script will de-select all the selected items:


 


 


 $(".grid-body-content-wrapper tbody tr").each(function(index)
{
$(this).attr('class', '');
})

Not sure if you looking for something more specific, if you have the list item ID and you want to de-select this specifc item, you can try the following:


 


$(".grid-body-content-wrapper tbody tr").each(function(index)
{
try
{
var itemType ;
itemType = JSON.parse($(this).find("td").eq(0).attr("data-options"));

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

$(this).attr('class', '');
}
}
catch(err)
{}
})

Hope that helps

Translate

Forum|alt.badge.img+8
  • Author
  • 35 replies
  • October 31, 2017

Hi Mustafa

 

For what I'm trying to do the first piece of code you send works great :)

Thanks for the quick reply
Paul

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings