Closed Level0r0s closed 8 years ago
Assign column's property 'editor' to 'ModelCombo' instance just created. Additionally, combo columns have to be presentation of references, not scalars as 'name'. It should be 'colName.field = "owner";' (if "owner" is property of 'model.customers' array elements). Platypus.js ORM is able to automatically add reference properties based on foreign keys between model's entities. Note, that foreign key is one property in entity's data array and reference property based on it is another property. Names of reference properties is settled up with designer via a context menu of corresponding dash line between entities in module's model view.
Reference properties can be created by ORM as well as with your JavaScript code with wide variety of ways...
in example PetHotel, OwnerView, no exist datamodel, model is passed by reference in runtime. (DATAMODEL is empty) ; for this reason. it is not possible to change Model GridColumn grdPets.petType to petTypesQuery
When I fill out ModelCombo.displayList property in ModelGridColumn grdPets.petType, this column does not list the petTypesQuery model. Does not accept that I write manually using the IDE Designer.
Solution: 1 in OwnerView.Datamodel, ADD petTypesQuery 2 chage ModelGridColumn grdPets.petType, ModelCombo.displayList to petTypesQuery 3 Save 4-1- in OwnerView.Datamodel, REMOVE petTypesQuery 5-SAVE
Can you clarify please what for do you change grdPets.petType.editor.displayList from data array of OwnersView's data model to another data array from OwnerView's data model?
Regarding your solution. It is quite well, but PetHotel example is organized so to avoid bunch of network requests (one for each OwnerView
module instance). Pet types is commonly used data and so, it can be pulled from server only once.
I did not change. For some reason, grd Pets.pet Type.editor.de playlist was empty. So I tried to replace and was not getting.
I've double checked just now examples work properly both on site and in fresh example project (new project -> Examples -> Platypus.js -> PetHotel) created via designer on local machine. There is data in form.grdPets.petType.editor.displayList
in both cases.
May be all of this is another problem. Check please if your program calls model.requery(function(){})
, and if database connection is properly configured and etc.
Could you please share your project (github, archive, or some another way). Append database to the project (h2 for example) and its credentials - username and password. Using this materials we will be able to solve problems of your project.
Example:
linking? colName with modelCombo