Skip to content

Freeze and unfreeze grid #142

@MikeSpock

Description

@MikeSpock

I don't see a way to freeze and unfreeze the grid, meaning that all items should become fixed, not draggable or scalable.

I wrote a rather dirty workaround:

const toggleFreeze = (shouldFreeze) => {
        for(let item of items){
            for(let key in item){
                if(typeof(item[key].fixed) === 'boolean' ){
                    item[key].fixed = !!shouldFreeze;
                    item[key].resizable = !!shouldFreeze;
                    item[key].draggable = !!shouldFreeze;
                }
            }
        }
    }

but it has one caveat. After toggling the grid needs to update in order to change to fixed elements, which I don't know how to trigger within the code. So it waits until some user action to take effect.

Is there any other way to freeze the grid and unfreeze it if necessary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions