Hello,
That's my first post here :). I have a question about ajax module and models. Is it possible to use different classes for instantiate models?
Let's say I have 4 models:
- Task - base model
- TodoTask - subclass of Task
- DoingTask - subclass of Task
- DoneTask - subclass of Task
My backend returns all tasks with additional field called "type" which represent the type of the task. I would like to use that field to instantiate proper class - if type is set to 'todo' it should create TodoTask, if it's 'doing' it should create DoingTask etc.
I know in Backbone there is a special function "parse" in the collection. I was wondering if it's possible to achieve something similar in Spine.
If it's not possible maybe there is different way to achieve something similar?