Splitted: function(sender, args);
sender. Event source.
args. Information on the event. Arguments: Left - left part of the term after split, Middle - term separator, Right - right part of the term after split.
The Splitted event occurs after the term is split.
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 formula editor and add a term with the 42 contents:
function createTerm() { // Create a formula editor termEdit = new PP.Ufe.Ui.TermEdit({ // Set parent element ParentNode: document.getElementById("termEdit") }); termEdit.insertString("42"); }
Put the cursor between the 4 and 2 characters. Get the selected term and set a handler of the Splitted event for it, set a keyboard key press event handler for the formula editor:
// Get selected term term = termEdit.getCaretMetadata().Term; // Add term split event handler term.Splitted.add(function (sender, args) { console.log("Selected term is split"); });
Split the term with space. As a result the term is split into two parts:
The console displays a message about term split:
The selected term is split
See also: