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

Select items in widgets with JS

SOLVED
Highlighted
Garnet

Select items in widgets with JS

Who can I select items in widgets like "select" or "list" via javascript?

I want to achieve something like, click a next button and select the next item in a list.

 

Can I somehow utilize the "clickitem" event, or simulate a click otherwise to select a specific item in the list?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Select items in widgets with JS

I found the solution myself.

 

twx.app.fn.clickItemInRepeater = function(item,list,isMultiSelect);

 

View solution in original post

2 REPLIES 2
Highlighted

Re: Select items in widgets with JS

I found the solution myself.

 

twx.app.fn.clickItemInRepeater = function(item,list,isMultiSelect);

 

View solution in original post

Highlighted

Re: Select items in widgets with JS

Fine solution. But to be more understandable for other members I will to add some details

1.) how to find this function if you have no idea where to look for it.

so simple printing of object in the chrome debugging console

e.g. 

console.warn($scope.app.fn);

 

 

2019-07-17_18-40-15.jpg

 

2.) So here we can print first the $scope and from there we can search for some other functionality  here $scope.app.fn

Now to check if this work we can define the following functions:

 

$scope.app.fn.clickItemInRepeater = function(item,list,isMultiSelect)
//other name for twx.app
{

   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);

};  
  
$scope.app.fn.clickItemInSelect= function(list,isMultiSelect,value,valueField)
{

   console.log("$scope.app.fn.clickItemInSelect list"); console.warn(list);
  console.log("$scope.app.fn.clickItemInSelect isMultiSelect"); console.warn(isMultiSelect);
  console.log("$scope.app.fn.clickItemInSelect value"); console.warn(value);
  console.log("$scope.app.fn.clickItemInSelect valueField"); console.warn(valueField);
  

};    
  

3.) And test in the console windows of chrome

3.1)  clickItemInRepeater funciton for dataGrid and repeater widgets

2019-07-17_18-51-13.jpg

3.2) and for the slect widget:

 

2019-07-17_18-50-35.jpg

Announcements
Join an
AR Working Group!

Topics available:
AR/VR for Data Optimization AR/VR for Security and Control AR/VR for Inspection