Skip to main content
1-Visitor
Jul 11, 2019 1:03 PM UTC
Solved

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?

feilAnswer
1-Visitor
Jul 15, 2019 7:16 AM UTC

I found the solution myself.

 

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

 

2 replies

feil1-VisitorAuthorAnswer
1-Visitor
Jul 15, 2019 7:16 AM UTC

I found the solution myself.

 

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

 

Translate
21-Topaz I
Jul 17, 2019 5:01 PM UTC

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

Translate