{"action":"created","issue":{"url":"https://api.github.com/repos/artf/grapesjs/issues/1385","repository_url":"https://api.github.com/repos/artf/grapesjs","labels_url":"https://api.github.com/repos/artf/grapesjs/issues/1385/labels{/name}","comments_url":"https://api.github.com/repos/artf/grapesjs/issues/1385/comments","events_url":"https://api.github.com/repos/artf/grapesjs/issues/1385/events","html_url":"https://github.com/artf/grapesjs/issues/1385","id":354203463,"node_id":"MDU6SXNzdWUzNTQyMDM0NjM=","number":1385,"title":"about the use of setAttributes","user":{"login":"ionic666","id":36065691,"node_id":"MDQ6VXNlcjM2MDY1Njkx","avatar_url":"https://avatars3.githubusercontent.com/u/36065691?v=4","gravatar_id":"","url":"https://api.github.com/users/ionic666","html_url":"https://github.com/ionic666","followers_url":"https://api.github.com/users/ionic666/followers","following_url":"https://api.github.com/users/ionic666/following{/other_user}","gists_url":"https://api.github.com/users/ionic666/gists{/gist_id}","starred_url":"https://api.github.com/users/ionic666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ionic666/subscriptions","organizations_url":"https://api.github.com/users/ionic666/orgs","repos_url":"https://api.github.com/users/ionic666/repos","events_url":"https://api.github.com/users/ionic666/events{/privacy}","received_events_url":"https://api.github.com/users/ionic666/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-27T07:02:33Z","updated_at":"2018-08-30T14:51:40Z","closed_at":null,"author_association":"NONE","body":"\r\nhi，I saved an object in the custom property。\r\n![2018-08-27_145924](https://user-images.githubusercontent.com/36065691/44645342-e2205f00-aa09-11e8-9b70-c5db90b78320.png)\r\nAnd I want to implement putting values into custom properties。\r\n![2018-08-27_150059](https://user-images.githubusercontent.com/36065691/44645389-07ad6880-aa0a-11e8-804b-17844b300833.png)\r\nbut It will cover the previous one\r\n![2018-08-27_150154](https://user-images.githubusercontent.com/36065691/44645441-34fa1680-aa0a-11e8-804d-0d8f0a4b5591.png)\r\n![2018-08-27_150211](https://user-images.githubusercontent.com/36065691/44645443-375c7080-aa0a-11e8-9ad7-01024ef864bc.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/artf/grapesjs/issues/comments/417347897","html_url":"https://github.com/artf/grapesjs/issues/1385#issuecomment-417347897","issue_url":"https://api.github.com/repos/artf/grapesjs/issues/1385","id":417347897,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzM0Nzg5Nw==","user":{"login":"arthuralmeidap","id":218371,"node_id":"MDQ6VXNlcjIxODM3MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/218371?v=4","gravatar_id":"","url":"https://api.github.com/users/arthuralmeidap","html_url":"https://github.com/arthuralmeidap","followers_url":"https://api.github.com/users/arthuralmeidap/followers","following_url":"https://api.github.com/users/arthuralmeidap/following{/other_user}","gists_url":"https://api.github.com/users/arthuralmeidap/gists{/gist_id}","starred_url":"https://api.github.com/users/arthuralmeidap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthuralmeidap/subscriptions","organizations_url":"https://api.github.com/users/arthuralmeidap/orgs","repos_url":"https://api.github.com/users/arthuralmeidap/repos","events_url":"https://api.github.com/users/arthuralmeidap/events{/privacy}","received_events_url":"https://api.github.com/users/arthuralmeidap/received_events","type":"User","site_admin":false},"created_at":"2018-08-30T14:51:40Z","updated_at":"2018-08-30T14:51:40Z","author_association":"CONTRIBUTOR","body":"so, in the second case do you want to update the same `data-info` attribute with a new key, right?\r\n\r\nsince `data-info` has a string as a type value, first you need to get it and parse to an object.\r\n\r\n`const dataInfoObject = JSON.parse(this.model.get('data-info'))`\r\n\r\nafter that, you can update the object with the new key\r\n\r\n`dataInfoObject[newKey] = newValue`\r\n\r\nand then you change it back to string and replace the attribute value for your model\r\n\r\n`this.model.set('data-info', JSON.stringfy(dataInfoObject))`\r\n\r\n\r\nlet me know if it works"}}
{"actor":{"display_login":"arthuralmeidap"}}