I can recommend reading this:
Simple Integration of Supermodel and Appcelerator Titanium Alloy by Aaron Saunders.
Supermodel can handle relationships of models.
Question
Suppose I have the model as follows. This represents a gym.
I have an exercise and I have an exercise type. They have a many-to-many relationship
Exercise {
EXERCISE_ID
NAME
}
Exercise_Type {
EXERCISE_TYPE_ID
NAME
}
TYPE_EXERCISE {
EXERCISE_ID
EXERCISE_TYPE_ID
}
I want to display a table with the information
Exercise Name | Exercise Type
I know how to do this with a raw sql query but I'm not sure how to execute raw sql with alloy. And once I have the proper data, how do I return that to the collection. All the tutorials I have found show how to do it via the XML but that is in the situation where the table columns are all displayed and exactly match the model columns.
Thanks, Mike
La solution
I can recommend reading this:
Simple Integration of Supermodel and Appcelerator Titanium Alloy by Aaron Saunders.
Supermodel can handle relationships of models.