JointJS: Embed Parents and Children [closed]

4

Good,

I'm working with JointJS but in a dynamic way.

At this point I'm trying to embed the 'parent' and 'child' elements.

After doing the select with the info of the child and parent, I make a get to go get this information: QUERY

<?php public function getElemLinks($param)
{
    $this->cleanErrors();
    $this->sql->cleanErrors();

    $query="SELECT
                linkEl.ID,
                linkEl.id_arquitectura,
                linkEl.nome_link,
                linkEl.source_box,
                linkEl.target_box,
                linkEl.link_texto,
                linkEl.link_textPos,
                linkEl.link_strokeCor,
                linkEl.link_strokeWidth,
                linkEl.link_router
            FROM
                arquitecturas_link_elementos as linkEl          
            WHERE
                linkEl.id_arquitectura = '".$param['arquitectura']."'
            ";

    $this->sql->query($query);

    //echo $query;

    if($this->sql->hasErrors()){
        $this->errors = $this->errors + $this->sql->errors;
        return false;
    }

    while($row = $this->sql->fetchRow())
    {
        $res[] = $row;
    }

    if($this->sql->hasErrors()){
        $this->errors = $this->errors + $this->sql->errors;
        return false;
    }

    return $res;
} ?>

GET - JSON

$.getJSON( "controller/diagramas.php", {
    arquitectura: servicoUtilizado,
}, function(infoElementos){ 
    $.each(infoElementos["parents"], function(prindex, objp){
        //Embed boxes 'filhos' nas áreas 'pai'
        console.log(object.caixas[objp.parentNome].embed(object.caixas[objp.nome_caixa]));
    });


});

What happens is that when implementing this code, the child elements get stuck and do not give to drag and as soon as I move the parent element the child elements do not accompany it, as is supposed.

    
asked by anonymous 04.12.2015 / 16:14

0 answers