EndDeletePressed: function(sender, args);
sender. Event source.
args. Event information.
The EndDeletePressed event occurs after pressing the DELETE key when the cursor is after the last term character.
To execute the example, the HTML page must contain links to the PP.js and PP.Ufe.js scenario files and PP.css and PP.Ufe.css styles files in the <body> tag of HTML document of the <div> element with the "termedit" identifier. Create a term editor and add the 20+30 string:
function createTerm() { // Create a formula editor termEdit = new PP.Ufe.Ui.TermEdit({ // Set parent element ParentNode: document.getElementById("termEdit") }); // Add terms termEdit.insertString("20+30"); }
Put the cursor to the term with the 20 contents. Add a handler of the EndDeletePressed event to the selected term, set a keyboard key press event handler to the formula editor:
// Get selected term term = termEdit.getSelectedTerm(); // Set pressing DELETE key after term event handler for the selected term term.StartBackspacePressed.add(function (sender, args) { console.log("The DELETE key is pressed after the selected term"); });
Put the cursor after the term with the 20 contents and press the DELETE key. As a result the term with the + contents is deleted:
The console displays a message about pressing the DELETE key after the selected term:
The DELETE key is pressed after the selected term
See also: