DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR. Enter additional information related to this 'class' inside the {div} macro with 'id=description'
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientservoy sSummary12%30%58%height: 30px;3Constants SummaryConstant returned by JSEvent.Constant returned by JSEvent.Constant returned by JSEvent.Constant returned by JSEvent.Constant returned by JSEvent.Constant returned by JSEvent.Constant for the ALT modifier that can be returned by JSDNDEvent.
if (event.getType() == JSDNDEvent.ONDRAGEND)
{
// its an on drag end event.
// return true if the drop has been completed successfully
return event.isDropSuccess();
}
...
class
lastDetailRow
...
id
ONDRAGOVER
Table Row (tr)
id
name
Table Cell (td)
ONDRAGOVER
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Constant returned by JSDNDEvent.getType() in a method that is attached to an onDragOver event.
if (event.getType() == JSDNDEvent.ONDRAGOVER)
{
// its an on drag over event.
// return true if it over the right element.
return event.getElementName() == 'candroponelement';
}
...
class
lastDetailRow
...
id
ONDROP
Table Row (tr)
id
name
Table Cell (td)
ONDROP
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Constant returned by JSDNDEvent.getType() in a method that is attached to an onDrop event.
if (event.getType() == JSDNDEvent.ONDROP)
{
// its a on drop event.
var element = elements[event.getElementName()];
// do drop on element
return true;
}
...
class
lastDetailRow
...
id
RIGHTCLICK
Table Row (tr)
id
name
Table Cell (td)
RIGHTCLICK
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Constant returned by JSEvent.getType() in a method that is attached to an onRightClick event.
// A client design method that handles ondrag
if (event.getType() == JSEvent.ONDRAG)
{
// the data is the selected elements array
var elements = event.data;
// only start a client design drag when there is 1 element
if (elements.length == 1)
{
return true;
}
}
// code for a data drag method
event.data = "drag me!";
return DRAGNDROP.COPY;
// code for a data drop method
var data = event.data;
elemements[event.getElementName()].setText(data);
return true;
// only accept drag if data is a servoy record
function onDragOver(event)
{
if(event.dataMimeType.indexOf("application/x-servoy-record-object") == 0) return true;
else return false;
}
Number - a DRAGNDROP constant, representing the result of the drag action
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
function onDragEnd(event)
{
var dragResult = event.getDragResult();
if(dragResult == DRAGNDROP.NONE)
{
// the drag was canceled
}
else if(dragResult == DRAGNDROP.COPY)
{
// the drag ended with a copy action
}
else if(dragResult == DRAGNDROP.MOVE)
{
// the drag ended with a move action
}
}
returns the source component/element of the event. If it has a name the getElementName() is the name of this component.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
Object - an Object representing the source of this event.
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
// cast to runtime text field (change to anoter kind of type if you know the type)
/** @type {RuntimeTextField} */
var source = event.getSource();
var sourceDataProvider = source.getDataProviderID();
Returns the x position of the event, relative to the component that fired it, if applicable. For example drag'n'drop events will set the x,y positions.
Returns the y position of the event, relative to the component that fired it, if applicable. For example drag'n'drop events will set the x,y positions.
sIndent a DRAGNDROP constant, representing the result of the drag actionclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetElementNamename
getElementName()
dessIndent
returns the name of the element, can be null if the form was the source of the event.
ret
Returns
sIndent a String representing the element name.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetFormNamename
getFormName()
dessIndent
returns the name of the form the element was placed on.
ret
Returns
sIndent a String representing the form name.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetModifiersname
getModifiers()
dessIndent
Returns the modifiers of the event, see JSDNDEvent.MODIFIER_XXXX for the modifiers that can be returned.
ret
Returns
sIndent an int which holds the modifiers as a bitset.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetNamename
getName()
dessIndent
Returns the name of the event which was triggered
ret
Returns
sIndent name of event as stringclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetRecordname
getRecord()
dessIndent
Returns the record of the event.
ret
Returns
sIndent Record of the eventclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetSourcename
getSource()
dessIndent
returns the source component/element of the event.
If it has a name the getElementName() is the name of this component.
ret
Returns
sIndent an Object representing the source of this event.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetTimestampname
getTimestamp()
dessIndent
Returns the time the event occurred.
ret
Returns
sIndent a Date when this event happened.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetTypename
getType()
dessIndent
returns the dnd event type see the JSDNDEvents constants what it can return.
ret
Returns
sIndent a String representing the type of this event.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetXname
getX()
dessIndent
Returns the x position of the event, relative to the component that fired it, if applicable.
For example drag'n'drop events will set the x,y positions.
ret
Returns
sIndent an int representing the X position.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetYname
getY()
dessIndent
Returns the y position of the event, relative to the component that fired it, if applicable.
For example drag'n'drop events will set the x,y positions.
ret
Returns
sIndent an int representing the Y position.clients