cancel
Showing results for 
Search instead for 
Did you mean: 

Get all items from a filter in WorkView using Javascript

Luiz_Paulo_Lind
Champ on-the-rise
Champ on-the-rise

I want to get a count from all items in a filter using the javascript API. Is it possible?

1 ACCEPTED ANSWER

Luiz_Paulo_Lind
Champ on-the-rise
Champ on-the-rise

I have found a way to do it manipulating the DOM object


var body = document.querySelector("[data-role=\"filterbody\"] table tbody");

document.getElementById('qtdItens').innerText = (body.rows.length -1);


(minus 1 because it counts the header row)

View answer in original post

3 REPLIES 3

Daniel_Quill
Elite Collaborator
Elite Collaborator

Luiz,


The only thing that the API provides is a list of 'SelectedItems'. You may be able to select all the rows in the filter and use the length property to get a count of the 'SelectedItems'.


-- Screen.CurrentView.Filters("MyFilter").length


Luiz_Paulo_Lind
Champ on-the-rise
Champ on-the-rise

Thanks Daniel, but i have to do this automatically, so the user interaction is not an option...

Luiz_Paulo_Lind
Champ on-the-rise
Champ on-the-rise

I have found a way to do it manipulating the DOM object


var body = document.querySelector("[data-role=\"filterbody\"] table tbody");

document.getElementById('qtdItens').innerText = (body.rows.length -1);


(minus 1 because it counts the header row)