How to update attributes of cells in rappidjs

267 Views Asked by At

I need to update the values of the cell attributes of rappidjs using jquery. How can we do that?

1

There are 1 best solutions below

2
user3664950 On

Somewhere need to do work like it

makeIconInElements(app.graph.toJSON());

function makeIconInElements(json2) {

    if (json2 != undefined) {
       let changedJson = json2;

        changedJson.cells.forEach(function (cell) {
            if (cell.type == ){ }

     

        });
        app.graph.fromJSON(changedJson);
        //resizeCell(app.paper.model);

        //Resizing the cell if icons are outside the box.
        changedJson.cells.forEach(function (cell) {
            let getAllCells = app.graph.getCells();
            if (cell.showIcons) {
                let currentResizingStep = getAllCells.filter(function (el) { return el.attributes.id == cell.id; });
                autoResize(app, currentResizingStep[0]);
            }
        });

        if (lastModifiedStep.attrs.task.status != abs") {
            currentRunningPosition = lastModifiedStep.position;
            app.paperScroller.scroll(currentRunningPosition.x, currentRunningPosition.y);
        }
    }
}