%%PageItemTitle%%

VectorDraw Web Library

JsPropertiesExtractor Send comments on this topic.
vdSelectionModified Field
See Also  Example
vdWebLibrary Namespace > vdrawObj Class : vdSelectionModified Field
Represents a user define function of type vdSelectionModifiedDelegate that will be called for every user select

Syntax

JScript 
public var vdSelectionModified : vdSelectionModifiedDelegate;

Example

Example 1: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.
Example 2: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.
C#Copy Code
vdcanvas.vdSelectionModified = _vdSelectionModified;//We set the event in the vdrawInitPageLoad() 
//Then we create the function which take as parameteres args 
 
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. 
C#Copy Code
vdcanvas.vdSelectionModified = selectionmodified;//We set the event in the vdrawInitPageLoad() 
//Then we create the function which take as parameteres eventargs 
//and we will finish the selection if at least one vdLine is selected. 
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;  
}

See Also