Into a Convertigo mobilizer project, the objects use the sencha touch API.
In this API, some parameters of the select object must be overridden to let it to receive the good values from a store:
valueField : Corresponds to the "value" property of the select's option tag (must exist in the model). Default value="value"
displayField : Corresponds to the content of the select's option tag (must exist in the model). Default value=="text"
You can see below a full example which show how to configure a select object.
| Code: |
Ext.regModel('DatesList', {
fields: [
{name: 'date', type: 'string'}
]
});
store = new C8O.Store({
model: 'DatesList',
root: 'document.dates.date', //the root object to iterate on
server : server //a C8O server object
});
var select = new Ext.form.Select({
name: 'dateD', //Name of the parameter posted with the form
label: 'date of departure', //Label displayed of the select
valueField: 'date', //Corresponds to the "value" property of the select's option tag (must exist in the model). Default value="value"
displayField: 'date', //Corresponds to the content of the select's option tag (must exist in the model). Default value=="text"
store: store //the store containing the data. Must be load with a sequence or a transaction
});
...
store2.load({
transaction: 'listAvailableDates', // transaction on C8O server
});
...
|