Problem in generating keys

Hi
I have tables and its columns.For table key is generated but for columns it generates dynamically by new myDiagramModalInputTable.model=go.GraphLinksModel(nodeDataArray, linkDataArray); When i am using two tables then its columns don’t provide right key and mismatch occurs.How can we assign data in model in other way.

Can you please tell me the purpose of _gohashid .if it is same for two nodes then what will be the affect.
:

You should not be looking at or saving “__gohashid”, and you certainly should not be setting it. That’s an internal property.

I do not understand your situation and what the problem is.

Actually i am dropping two nodes and their gohashid is also same.
i have two object like this

Object
CREATEDATE
:
“”
Description
:
“Workspace table”
ErrorList
:
Array(0)
Fields
:
Array(1)
IsTemporary
:
false
LANGCD
:
“en”
LANGNM
:
“English”
LOGICALTABLENAME
:
" Abhishek Gupta"
MODIFIEDDATE
:
“”
MultiLangs
:
Array(0)
PHYSICALTABLENAME
:
“AbhishekGupta10138”
ShowCheckbox
:
false
TABLETYPE
:
“Existing”
TempID
:
null
WORKSPACETABLEID
:
“10138”
category
:
“Table”
from
:
-1
isGroup
:
true
key
:
-1
to
:
“-3”
__gohashid
:
2957
ko_mapping
:
Object
proto
:
Object
1
:
Object
CREATEDATE
:
“”
Description
:
“Workspace table”
ErrorList
:
Array(0)
Fields
:
Array(1)
IsTemporary
:
false
LANGCD
:
“en”
LANGNM
:
“English”
LOGICALTABLENAME
:
" Abhishek Gupta"
MODIFIEDDATE
:
“”
MultiLangs
:
Array(0)
PHYSICALTABLENAME
:
“AbhishekGupta10138”
ShowCheckbox
:
false
TABLETYPE
:
“Existing”
TempID
:
null
WORKSPACETABLEID
:
“10138”
category
:
“Table”
from
:
-2
isGroup
:
true
key
:
-2
to
:
“-3”
__gohashid
:
2957
ko_mapping
basis on these two objects keys i generates other nodes and their group id is its key.

hence after assigning data array to model .I got like this

“10771”
COLUMNSIZE
:
“4000”
COLUMNTYPE
:
“String - Dynamic length (With Unicode)”
CREATEDATE
:
null
FunctionID
:
“”
LANGCD
:
“en”
LANGNM
:
“English”
LOGICALCOLUMNNAME
:
" col 1"
MODIFIEDDATE
:
null
MultiLangs
:
Array(0)
PHYSICALCOLUMNNAME
:
“col110771”
TableName
:
“C_WORKSPACETABLECOLUMN_N”
TimeTableName
:
“”
WORKSPACETABLEID
:
“10138”
category
:
“Column”
group
:
-1
isColumnSizeEditable
:
undefined
key
:
-6
loc
:
“43.5 121.45”

group id should be -2.But after assigning it in model. it automatically converts to -1.

I repeat my previous admonition:

ok leave that but why the group id is changing dynamically after data assigning to model.

Messing with the “__gohashid” might cause problems like that.

I don’t make any changes in “__gohashid”.This problem is coming after assigning data to model.

So you are guaranteeing that your code never reads or writes the “__gohashid” property?

If so, can you tell us how to reproduce the problem in one of the standard sample apps?

Hi Walter…

As I get from @riya1 she is asking about nodeDataArray in model. Issue is like their are two node in canvas A and B(both node same data). both also have same _gohashid while checking diagram.model.nodeDataArray in debugging. But we are getting only single node on canvas. Is it have any negative effect on canvas.

yes i don’t do any changes in “__gohashid” .

When the “_gohashid” is same for two nodes on clicking bootstrap model I am getting only one node.
But when i am reloading my page then “_gohashid” are different for both the nodes and i am getting two nodes.

If the user is drag-and-dropping two new nodes from another (or even the same) diagram, there will be two different data objects added to the Model.nodeDataArray, so they will have different internal hashids.

If your code is adding the same Object to the nodeDataArray more than once, that does not make sense – don’t do that.

Objects data are same but their key is different ok.