Article | 70001053 |
Type | Wish |
Product | WebJS |
Version | 7010 |
Date Added | 4/4/2017 12:00:00 AM |
Fixed | 7.7011.0.3 (4/6/2017 12:00:00 AM) |
Submitted by | Brendan Fry |
Summary
User can complete the selection by code without right click or double click
Solution
In version 7011.0.3 new arguments have been added in vdcanvas.vdSelectionModified method so user can cancel the
selection by code whenever he wants.
vdSelectionModifiedDelegate( SelectionModifiedArgs args)
SelectionModifiedArgs takes the selectedItem,the cancel value and the finish value
Example: For example we allow user to select only one line("vdLine").So every time that copy,rotate,scale,move functions are called,only one line can be selected.
vdcanvas.vdSelectionModified = selectionmodified;//We set the event in the vdrawInitPageLoad()
//Then we create the function which take as parameteres eventargs
function selectionmodified(eventargs) {
//select only one vdLine object
if (vdcanvas.Fig_codeToString(eventargs.selectedItem._t) != "vdLine" || eventargs.action.customData.length > 1)
eventargs.cancel = true;
else if (eventargs.action.customData.length < 1)
eventargs.finish = true; //finish the selection if at least one vdLine is selected.
}