Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Custom text editor editing 2 text block at the same time

$
0
0

@uriel wrote:

We have a link element that has a part attached to it. This part is built from 2 textBlock s, so we can present the two text part s in different colors.

In order to edit those values, we use a textEditingTool that have 2 dropdowns that should affect both of the text blocks.

This is a snippet of the current diagram with the relevant element marked in red:
pic1

This is a snippet of the open editor:
pic2

The editor is allowing to change both of the textBlock s values and the same editor is opened for both textBlock s.

The value model of the editor is an object, containing to properties that holds the values from both dropdowns.

Every time one of the dropdowns is changing, the value model is being updated and editor element.value is being set to function that returns the value object:

value = {prop1: {}, prop2:{}};

this.element.value = () => this.value;

Both text blocks have 2 way binding that are getting the value that was set on the editor’s element value.

The problem is that the value that makeTwoWay () is getting is evaluated as string and no matter through which textBlock I opened the editor, it is being updated with the value object as string.

My questions are:

  • How can I get the actual value object from the editor, not as string, so I can go ahead and update and manipulate my code accordingly?
  • Is there a way to create a single textBlock that is made out of two words in different colors?
  • Is there a way to edit the panel that hold the two text blocks?
  • Is there another way to do that?

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles