Hi,
I am using a textblock in an “Auto” panel by specifying specific properties to that textBlock. Most of these properties are not working. Below is the textBlock I defined
On click of textBlock to edit, The text area height and width are not taken as given. Also textAlign is not working.
Can you please let me know why it is so and help me if I am missing anything.
The text editor that is used for entering text is independent of the TextBlock that renders text. You can customize the text editor as much as you like – I suggest that you start with the implementation that we provide, which is given in http://gojs.net/latest/extensions/TextEditor.js and used in HTMLInfo Text Editor.
There are other useful text editors in the extensions directory as well as in the samples directory.
But still any height given less than ‘125px’ to the textBlock is not being taken by it.
I inspected the height of the textblock in the debugger and figured out this issue.
For heights greater than ‘125px’, it is working as expected.
I found the same issue even without using any custom editor.
Was the textBlock given any min height kind of thing? Can you help me to fix this issue.
Hi Walter,
Did you check this?
One more thing I need your help regarding textBlock. Can I implement auto-fill a set of suggested values for a textBlock?
Okay Walter, Thanks for the suggestion. I’ll make use of that TextBlock.choices property.
But regarding the height issue, I have shown the template how I constructed the TextBlock and the properties I gave to it.
With and without using the custom textEditor, I had the same problem. By the CSS rule override you mean, the properties I defined to the textBlock or the customTextEditor?
The template defines the visual tree for each node automatically created for model data objects. Your code did not show how the TextEditingTool would create an HTML textarea for in-place editing of a particular TextBlock.
The behavior of the text editor is completely separate from the implementation of the textblock. Although the editor is certainly affected by the textblock’s properties.
I am using the same TextEditor given by you.
In that, the textarea height is calculated from the textBlock height as:
var textheight = (textBlock.naturalBounds.height * textscale) + 2;
As per my understanding, this calculated height will be taken by the text area during initialization for in-place editing of a TextBlock and so, the textarea should also take almost the same height what we give to the TextBlock.
If this is not the actual way how the textarea height is decided, Please suggest me where I need to set that height.