The List Views functions are described in the post with an example how to apply some of the functions
CountSelectedItems(ctx); return count of selected items in view
SelectRowByIndex(ctx,1,true); selects first item in list view
DeselectAllItems(ctx, tab.rows, false);deselects all items in view
SelectRibbonTab(“Ribbon.ListItem”,true); displays the listitem ribbon
The code below can be copied into a script editor web part on a list view page.
I created a list “Test Approve Items” with columns “Status”, and “Title” with 4 list items.
When “Select All” button is clicked, all items in the list view get selected.
When “Deselect All” is clicked, all items in the list view get deselected.
When “Show Ribbon” is clicked, the ribbon is shown
When “Set Approve” is clicked after selected some items, the status changes to “Approve”.