Hello there!
I have a question about SpineJS Models
My "TagTextField" is an HTML input Element, that allows the user to input a list of Tags. I already implemented a fancy way for entering new tags. Each Tag is an instance of my TagMdl class. But now I must be possible to show more than one tagtextfield on one page. How should I organize my TagMdl for that?
Possible Solution:
1) Let TagMdl now the HTML ID of the input element:
class TagMdl extends Spine.Model
@configure 'TagMdl', 'tagtextfield_ID', 'tagname'
Advantage: Now I can easily get the list of tags for each tagtextfield
Disadvantage: But now event handling gets impossible. If only one tag is added, I'd have to rerender all tagtextfields on the page.
2) Create a seperate set of tags for each tagtextfield.
This does not seem to be possible with spine, since a Spine.Model class has its class methods only once.
I am kind of stuck here. Any suggestions?
Yours,
Robert