Skip to content

Can i add ui.TextEditor to the items of standard.HeaderedRecord #2775

Answered by kumilingus
Naveena1321 asked this question in Q&A
Discussion options

You must be logged in to vote

Here is an example of how to edit an item to a double-click.

paper.on('element:magnet:pointerdblclick', (elementView: dia.ElementView, evt: dia.Event, magnet: SVGElement) => {
    evt.stopPropagation();
    const element = elementView.model as Records;
    const id = elementView.findAttribute('item-id', magnet);
    graph.startBatch('edit-item');
    element.attr([`itemLabel_${id}`, 'itemText'], { textWrap: false });
    function close() {
        ui.TextEditor.close();
        element.removeAttr([`itemLabel_${id}`, 'itemText']);
        graph.stopBatch('edit-item');
    }
    ui.TextEditor.edit(magnet, {
        cellView: elementView,
        textProperty: [...element.getItemPathArray(id), 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Naveena1321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants