
Missile behavior
| Name space | rialto.widgetBehavior |
| FILE | multi-files in rialtoEngine\javascript\core\coreBehaviors\DD_behavior.js |
| NAME | Missile/Target behavior |
| INHERITS | draganddrop |
| VERSION | 0.86 |
| update | |
| DESCRIPTION | It is rather the description of the affectation of the missile and target behavior (relative to several files) than the description of an independent component |
The missile behavior is a specific drag and drop Behavior. In Fact the missile can only be drop in specific element on which you attach the target Behavior.
Details of setup properties for the MISSILE
| Name | Type | Description | Default |
| domain | string | path to define authorized targets (ex. Tree.node) | |
| domainUnauthorizedTarget | string | path to define unauthorized targets (ex. Tree.node.leaf) | |
| targetChoice | string | choice between good targets strategy. If no value the target above (descendant of, or covered ) is the better. If 'firstIsBetter', the first target finded is the good (faster) | |
Details of setup properties for the TARGET
| Name | Type | Description | Default |
| domain | string | path to define authorized Missile | |
| missileAsOnePixel | boolean | if true the drop missile is seen as a one pixel object whatever its real size | true |
| borderIsTarget | boolean | if true the border of the target is reactive | true |
Example:
Missile:
var o = document.getElementById('objectToMove');
var setup={bMUpAction : false,
bRectLim : false,
ghost : {bIcone : true, aspect: 'icon'},
domainTargets:'tree.node'
,targetChoice : 'firstIsBetter'
});
rialto.widgetBehavior.affect(o,'Missile',setup);
Target:
var o = document.getElementById('objectToMove');
var setup={missileAsOnePixel:true,domain:'tree.node'};
rialto.widgetBehavior.affect(o,'Target',setup);
CALLBACK METHODS FOR THE TARGET
DDHover
this method is raise when a missile drag, move over the target
Parameters:
object oHtml:object with 3 properties 'oHtml','top','left' representing object drop,top and left in Target
The code must be redefine after . By default this method does nothing.
If this function is not redefine the default behavior is to surround the target in green (if the drop can be done) or red (no drop)
DDOuter
this method is raise when a missile drag, move out from the target
Parameters:
object oHtml:object with 3 properties 'oHtml','top','left' representing object drop,top and left in viewPort
The code must be redefine after . By default this method does nothing.
If this function is not redefine the default behavior is to remove the target decoration create on over.
receiveAfterDrop
Raise when a missile is drop in the target
Parameters:
object missile:object with 4 properties 'oHtml','top','left','doamin' representing object drop,top and left in Target and domain of the missile drop
The code must be redefine after . By default this method does nothing.
If this function is not redefine the default behavior is to drop the missile in the target