Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to create anchor pattern for each rows in table node (Read 231 times)
Gagandeep Singh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Dec 1st, 2022
How to create anchor pattern for each rows in table node
Feb 23rd, 2024 at 4:40pm
Print Post  
Hi there,

I have this code, and I want to add anchor pattern for each cell, unfortunately I can't do that. However, in .Net we can do using rows class and setting anchorPattern property there but how can I do in JS

Code (Javascript)
Select All
 var apat1 = new AnchorPattern([
        new AnchorPoint(100, 50, false, true, MarkStyle.X)
    ]);
    var tableNode = diagram.factory.createTableNode(new Rect(20, 78, 40, 30));
    tableNode.text = ("node 1");
    tableNode.isAnchorPatternVisible = true;
    tableNode.shape = MindFusion.Diagramming.SimpleShape.Rectangle;
    tableNode.allowResizeRows = true;
    tableNode.connectionStyle = MindFusion.Diagramming.ConnectionStyle.Node;

    var zeroCol = tableNode.getColumn(0);
    zeroCol.ColumnStyle = MindFusion.Diagramming.ColumnStyle.AutoWidth;
    var firstCol = tableNode.getColumn(1);
    firstCol.ColumnStyle = MindFusion.Diagramming.ColumnStyle.FixedWidth;
    firstCol.Width = 10;

    tableNode.redimTable(2, 2);
    var cell = tableNode.getCell(0, 0);
    cell.rowSpan = 2;
    cell.text = tableNode.text;
    cell.brush = tableNode.brush;
    cell.textAlignment = MindFusion.Diagramming.Alignment.Center;
    cell.lineAlignment = MindFusion.Diagramming.Alignment.Center;

    var cell1 = tableNode.getCell(1, 0);
    cell1.text = "1";
    cell1.tag = 1;
    cell1.brush = tableNode.brush
    cell1.textAlignment = MindFusion.Diagramming.Alignment.Center;
    cell1.lineAlignment = MindFusion.Diagramming.Alignment.Center;

    var cell2 = tableNode.getCell(1, 1);
    cell2.text = "2";
    cell2.tag = 2;
    cell2.brush = tableNode.brush;
    cell2.textAlignment = MindFusion.Diagramming.Alignment.Center
    cell2.lineAlignment = MindFusion.Diagramming.Alignment.Center;

    cell1.anchorPattern = apat1;
    cell2.anchorPattern = apat1;
 


  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3159
Joined: Oct 19th, 2005
Re: How to create anchor pattern for each rows in table node
Reply #1 - Feb 26th, 2024 at 7:47am
Print Post  
Hi,

We'll try to implement row.anchorPattern for upcoming release.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Gagandeep Singh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Dec 1st, 2022
Re: How to create anchor pattern for each rows in table node
Reply #2 - Feb 26th, 2024 at 2:38pm
Print Post  
Okay great, thanks
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3159
Joined: Oct 19th, 2005
Re: How to create anchor pattern for each rows in table node
Reply #3 - Mar 11th, 2024 at 8:23am
Print Post  
This build adds TableNode.rowAnchorPattern and TableRow.anchorPattern properties -
https://mindfusion.eu/_beta/jsdiag442.zip

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint