Page 1 of 1

Count items

Posted: 17 Oct 2017
by danieljr
Hello Nikita,

Thanks for your reply on my previous post!
How can I use a show an number / amount of items in the current list based on the value of some fields ?

Thank you,

Daniël Pharazijn | IT-department | AG Stedelijk Onderwijs Antwerp Belgium

Re: Count items

Posted: 18 Oct 2017
by Nikita Kurguzov
Hello, Daniël!
The easiest way to do it, would be to add Related Items control to the form, select the same list, All Items view and Show all items from the view. You can also hide it, so it wouldn't show up on the form, by placing this line into Maket -> Style config:

Code: Select all

display: none;
And now you can use this line of JavaScript to get number of items in the list:

Code: Select all

fd.relatedItems(0).data('ctx').ListData.Row.length;
Another way to get the number of items would be to send an async request to the list.