Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
Change the color of the border in go js

I would like to change the black border to green when my changeColor function is called on click

I would like to know if someone can help me to find a solution because unfortunately I am stuck on it.

I thank you in advance for your answer view project

var commandsAdornment = $(
    "ContextMenu",
    $(
      go.Panel,
      "Auto",
      $(go.Shape, {
        fill: null,
        stroke: "deepskyblue",
        strokeWidth: 2,
        shadowVisible: false,
      }),
      $(go.Placeholder)
    ),
    $(
      go.Panel,
      "Horizontal",
      { defaultStretch: go.GraphObject.Vertical },
      $(
        "Button",
        $(go.Shape, {
          geometryString: "M0 0 M3 2 L3 0 7 0 7 10 3 10 3 8 M5 6 7 4 9 6 M10 0",
          fill: "",
          margin: 3,
        }),
        { click: changeColor },
      )
    )
  );
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You could have something like this as a "ContextMenuButton" GraphObject.click event handler:

    {
      click: (e, button) => {
        const node = button.part.adornedPart;
        const shape = node.findObject("SHAPE");
        if (shape) {
          e.diagram.commit(diag => shape.stroke = "green");
        }
      }
    }

This of course assumes that you have named the Shape that you want to modify with the { name: "SHAPE" } property in your node template.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda