Issue #1948Opened April 8, 2019by java8580 reactions

can't set property's name

Question

https://github.com/artf/grapesjs/issues/1398#issuecomment-417954677

Code SnippetTEXT
why i can't set any property ? i try to update dog's name into 'cat', but i can't make it. but followed your example code.  both set({ name: 'cat' }) and set('name', 'cat'). 
the only reason i have to update properties' name is because i want to change them into chinese. i read many issues about non-english language support, and you said set property new name is the only way. but it doesn't work.
thanks

`
const editor = grapesjs.init({
            container: '#gjs',
            components: '<div class="txt-red">Hello world!</div>',
            style: '.txt-red{color: red}',
        });
        const styleManager = editor.StyleManager;
        var sector = styleManager.addSector('mySector', {
            name: 'My sector',
            open: true,
            properties: [{ name: 'dog' }]
        });
        var property = styleManager.getProperty('mySector', 'dog').set('name', 'cat')
        console.log(property)
`
![1554714193(1)](https://user-images.githubusercontent.com/23737076/55714256-eb07f300-5a24-11e9-8fe1-83d6b8c4b990.jpg)
![1554714230(1)](https://user-images.githubusercontent.com/23737076/55714257-eba08980-5a24-11e9-9760-40502e408e58.jpg)
![1554714250(1)](https://user-images.githubusercontent.com/23737076/55714258-ec392000-5a24-11e9-8644-a632136b0976.jpg)

Answers (1)

lock[bot]April 15, 20200 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.