Hello all,
I have to do a manyTomany association with crud ability via session.
In my mySql database, I have 3 tables :
- article (with id + other fields)
- tag (with id + other fields)
- articleTag (with idArticle and idTag)
So I have to make 2 models with ajax proxy and api urls for crud
But how can I specify the association which have to know the existence of my third table ? (relation table with id's of articles and tags) ?
If I understood, in a manyTomany association, extjs use a "matrix" table which seems to be like my association table. How can I use it ?
Is there a way to use it to "crud" changes through my 3 mysql tabs with one action ?
what is the way/theory ?
I hope you understood my poor English...
Thank you
Ok, No answer ?
I declared my association in my Tag model as follow :
Code:
manyToMany: {
ArticleTags: {
type: 'Article',
role: 'articles',
field: 'idArticle',
right: {
field: 'idTag',
role: 'tags'
}
}
},
So I think the matrix table should have for name : ArticleTags
But I don't know where to put a proxy to specify crud api urls to request in my mysql relation table (similar to this Matrix table).
when I load articles in a grid and I test in console :
the record : I can see a session and an association so I think the declaration seems ok. NO ???
When I test with : Ext.ComponentQuery.query('grid')[0].getStore().findRecord('id',111).tags() or Ext.ComponentQuery.query('grid')[0].getStore().findRecord('id',111).getAssociatedData() the console
returns an empty tags array and it seems that there is no ajax call....
Please, help...
help...
...