Article | 70001029 |
Type | Wish |
Product | WebJS |
Version | 7010 |
Date Added | 3/14/2017 12:00:00 AM |
Fixed | 7.7011.0.1 (3/17/2017 12:00:00 AM) |
Submitted by | Brendan Fry |
Summary
A new event has been exported in version which fires for every entity the user selects.
Solution
In version 7011.0.1 a new event has been exported vdSelectionModified which fires for every entity the user selects.
Example:For example we allow user to select all of the entities except lines("vdLine").So every time that copy,rotate,scale,move functions are called,lines can not be selected.
vdcanvas.vdSelectionModified = _vdSelectionModified;//We set the event in the vdrawInitPageLoad()
//Then we create the function which take as parameteres args which contains the selected item that will be added in the selection and the cancel value which by default is false.
function _vdSelectionModified(args) {
//Now we do not allow the user to select lines and we set cancel=true;
if (vdcanvas.Fig_codeToString(args.selectedItem._t) == "vdLine") args.cancel = true;//cancel=true; means that the entity can not be select.
//Default value of cancel is false which means that every entity can be selected
}