Show names of each nodes in palette


#1

Hi, i need to show respective name on each node of my floorplan palette, is there any way i can set that.
i have tried setting “TextBlock” in my floorplanner-template-furniture.js file at makeDefaultNode() , but its generic for all which i dont want like in below image. Please help.
Floor%20Planner


#2

How do you want the text to be shown?


#3

i want to show different name for different node items, currently its showing same name for all node


#4

is there any way so that we can set the name for each node like below imagequestion


#5

Yes, you should use a TextBlock with a Binding of the TextBlock.text property.

$(go.TextBlock,
  new go.Binding("text"))

The “text” binding means the text for the node will come from the data. You can learn more about data bindings on the intro page.

Add whatever settings you need to give the text the appearance and behavior that you want.


#6

thank you for your help jhardy, i have already used that something like this

but the problem is that its showing same text “a Text Block” on every node of my palette. I want each node with different name.


#7

Did you read what I wrote about the “text” Binding? That’s how you can get different names from the data. Make sure your data has a property named “text”.

new go.Binding("text").makeTwoWay()

#8

hey thanks jhardy it works, thank you for your speedy help and support i appreciate it.