cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to use item click on data grid?

Jimmy4
6-Contributor

How to use item click on data grid?

For example, When a specific row in the data grid is selected, it would display a popup with labels that follow the rows items that was clicked on.

1 REPLY 1

Hi @Jimmy4 ,

you can use the following options.

The one option is to use directly the Item click.  You can define a code e.g.:

 

$scope.app.ItemClick=function() {
//console.warn($scope.view.wdg['dataGrid-1'])
  $scope.$applyAsync();  
  console.warn("selected Name="+$scope.view.wdg['dataGrid-1'].data.current.Name)
   console.warn("selected Value="+$scope.view.wdg['dataGrid-1'].data.current.val)
   console.warn("selected DESC="+$scope.view.wdg['dataGrid-1'].data.current.Desc)
}

 

2020-07-01_14-12-58.jpg

 

And then when we test it - we will have:

 

2020-07-01_14-09-27.jpg

 

You can alternative use also another listener to handle the selected value in the dataGrid widget. But , please, pay attention that this another option is global and will work for many dataGrid widgets and alo it will deactivate the ItemClick.  Means the ItemClick will work but the current selection is not updated. So that when you define the repeater listener the ItemClick will not be able to handle the current data Set:

 

 

twx.app.fn.clickItemInRepeater = function(item,list,isMultiSelect)
{
console.warn("called clickItemInRepeater()");
  console.log("twx.app.fn.clickItemInRepeater item"); console.warn(item);
  console.log("twx.app.fn.clickItemInRepeater list"); console.warn(list);
 console.log("twx.app.fn.clickItemInRepeater isMultiSelect"); console.warn(isMultiSelect);
  
  console.log("Item.name="+item.Name);
  console.log("Item.val="+item.val);
  console.log("Item.Desc="+item.Desc);
 
}; 

 

 

Top Tags