Regarding Text-block to be open as edited mode

Hello Support Team,

I am facing two challenge, of a canvas

  1. With event ExternalObjectsDropped.
    I have two type of shapes 1st is a basic shape and another is chevron shape.
    So when I drag a normal shape then, it’s text-block comes in an edited mode(Because all shapes are not interlinked) and i am using this code :
    var tb = myDiagram.selection.first().findObject(‘TEXT’);
    if (tb) myDiagram.commandHandler.editTextBlock(tb);
    But in the case of chevron, we interrelate all shapes forcefully .like this structure
    1->1>1->1
    Now I want to show text-block of Dragged chevron shape as an edit mode.
  2. On double click on any node, I want to show a shape in edit mode and selected text to be deleted.

So please provide support for these scenarios.

Thanks
Shivam Varshney

  1. I’m unclear what the question is here – you already seem to understand that you can call CommandHandler.editTextBlock in order to start editing a TextBlock. And that you can find a particular TextBlock (especially if there might be more than one of them), by giving a particular one a name and calling Panel.findObject to get a reference to it.

  2. Again, you already seem to know the answer to this, so I’m not sure what the question is. Maybe you want to do something like this on your Node template(s):

  ...,
  doubleClick: function(e, node) {
    var tb = node.findObject("TEXT");
    if (tb !== null) {
      tb.text = "";  // delete the text
      e.diagram.commandHandler.editTextBlock(tb);  // start the text editor
    }
  },
  ...