New Feature 11.0.0.7 - WebDocumentThumbnailer Multi Select
WebDocumentThumbnailer up to this point has supported only "single selection"
where one and only one thumbnail may be selected at a time
With the introduction of 11.0.0.7, we've added multi selection so that one
may select more than one thumbnail at a time
Two new config items for WebDocumentThumbnailer.config have been
added
selectionmode
and
selecteditemsorder
Selection mode toggles whether the control will allow single or multiple
selection while selecteditemsorder determines if selections will be in index
order (ascending) or in the order in which they were selected
Rotation:
the rotate-right / rotate-left buttons will now apply their
rotation to all selected pages if multiple pages are selected.. this overrides
the "normal behavior" of the current page being rotated
Configuration Properties
selecteditemsorder
values:
Atalasoft.Utils.SelectedItemsOrder.ItemIndexOrder
Default
selection list will be in ascending order by item
index
or
Atalasoft.Utils.SelectedItemsOrder.SelectedOrder
selection list will be in the order in which the selections were made
selectionmode
Determines the selection mode of the WebDocumentThumbnailer - can choose
single or multiple select
values:
Atalasoft.Utils.SelectionMode.SingleSelect
Default
One item selected at a time.. this is the behavior that matches
all previous versions
Atalasoft.Utils.SelectionMode.MultiSelect
Allows multiple selection... selecteditemsorder determines the order the
selection list will be in
Functions
selectThumb
void _thumbs.selectThumb(index, append);
Causes thumbnail at index to be selected (if append is true, does not change
status of other thumb selections, if false, then it will clear all other
selections and select only the thumbnail specified in index
index: the zero-based index of the thumbnail to select
append: true/false ... value of false will deselect all other
thumbs true will leave other thumbs selected as they were
return: none
deselectThumb
void _thumbs.deselectThumb(index);
Deselects the thumbnail specified (does not affect selection of any other
selected thumbs)
index: index of thumbnail to deselect
return: none
getSelectedPageIndex
number _thumbs.getSelectedPageIndex();
Returns the selected thumbnail index when Web Document Thumbnailer (WDT)
setup to use singleselect. When WDT setup to use multiselect, then this method
returns the first element of the selected page indices, with respect of
selecteditemsorder parameter value.
return: numerical index of "first" selected page in
selected indices (see getSelectedPagesIndices for all selected pages)
getSelectedPagesIndices
Array.<number> _thumbs.getSelectedPagesIndices();
Returns an array of selected indices in the selection order
return: an array of numbers (Array.<number>)
document.RotatePages
void _thumbs.document.rotatePages(indices, angle
[,callback]);
Given an array of indices (Array.<number>) it will rotate all items in
the array by the specified angle
Does not cause thumbnail selection/ change
thumbnail selections
indices: An array of indices to rotate
(Array.<number>)
angle: The angle to rotate (0,
90, 180, or 270)
callback: Optional callback function to
fire when completed
return: none
selectAllThumbs
There is no selectAll function. However, it's simple to implement with a bit
of JavaScript
if your WDT is named "_thumbs" you would call it using
selectAllThumbs(_thumbs);
code:
function selectAllThumbs(thumbnailViewer)
{
var frameCount = thumbnailViewer.getDocumentInfo().count;
for
(var i = 0; i < frameCount; i++) {
thumbnailViewer.selectThumb(i,
true);
}
}
deselectAllThumbs
There is no deselectAllThumbs function.. the WDT can never be in a state
where NO thumbnails are selected.. it must always have one. This means that
effectively, calling
_thumbs.selectThumb(someindex, false);
will deselect all thumbs except the on in the index. To make an
effective deselectAll, you could use it like this
deselectAllThumbs(_thumbs);
code:
function deselectAllThumbs(thumbnailViewer)
{
thumbnailViewer.selectThumb(thumbnailViewer.getCurrentPageIndex(),
false);
}
Events
thumbselected
_thumbs.bind('thumbselected', function(e) {
//e.index is the index of the selected thumbnail
});
Fires when a thumbnail is selected (but NOT when selection changes/
deselection is made, see thumbdeselected for that)
This is not a new event,
but is documented here for completeness
index: the index of the SINGLE thumbnail that just got selected
NOTE: use _thumbs.getSelectedPagesIndices() if you want the full list
thumbdeselected
_thumbs.bind('thumbdeselected', function(e) {
// e.index is the index of the thumbnail that was deselected
}
Fires when a thumbnail is deselected (but not just a general selection change
or when selected .. see thumbselected for that)
Original Article:
Q10457 - INFO: WebDocumentThumbnailer Multi Select (New in 11.0.0.7)