OnMouseActionHandler

Description

An OnMouseActionHandler is a type that defines a function which will evaluate if the mouse event can start the edit mode. The EditTriggers.OnMouseAction provides the common mouse action functions.

Arguments

Parameters

Type

Description

context

OnMouseActionContext

The context of the mouse action.

[output]

boolean

true when the mouse event can start the edit mode, otherwise false.

Example

In this first example, the mouseStartEdit function triggers the edit mode when the mouse is clicked while the alt key is pressed. This function is set as an OnMouseActionHandler for the EditTriggers.onMouseAction.

function mouseStartEdit(context)

{

  if (context.actionType === "click" && context.isAltKeyPressed)

    return true;



  return false;

}



const editTriggers = {

  onMouseAction: mouseStartEdit,

};

This editTriggers object should be set in the dataGridOptions.editTriggers property.

In this second example, the EditTriggers.onMouseAction.singleClick function is set as an OnMouseActionHandler for the EditTriggers.onMouseAction. It will trigger the edit mode when a mouse single click happens on the dataCells.

const editTriggers = {

  onMouseAction: Xceed.EditTriggers.onMouseAction.singleClick

};

This editTriggers object should be set in the dataGridOptions.editTriggers property.