Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to serialise and deserialise custom attributes #298

Open
suityou01 opened this issue Feb 4, 2021 · 0 comments
Open

How to serialise and deserialise custom attributes #298

suityou01 opened this issue Feb 4, 2021 · 0 comments

Comments

@suityou01
Copy link

I have followed the subclassing documentation as far as I can, but I have found the document tails off a bit prematurely as it only shows 'aprop' as an extra argument to the _fromObject method. It is not clear to me at all how to deserialise custom attributes.

Can you point me at an example of such?

Here is my latest fruitless attempt :

fabric.MyCustomWidget.fromObject = function(object, callback) { return fabric.Object._fromObject('Event', object, callback, { 'id': object.customAttribute1, 'name': object.customAttribute2 }); }

NB I have sucessfully written the toObject override for the subclass and it serialises the custom attributes ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant