Hi Anon.
If i understand you correctly you want to create datasource manualy and manualy set for this datasource mapping.
Here is an example of such code:
pre
code
Code: Select all
dogList = new Apperyio.DataSource(ToDoDB_dogs_list_service, {
'onBeforeSend': function(jqXHR) {
},
'onComplete': function(jqXHR, textStatus) {
Apperyio.refreshScreenFormElements("Screen3");
},
'onSuccess': function(data) {},
'onError': function(jqXHR, textStatus, errorThrown) {},
'responseMapping': [{
'PATH': ['$'],
'ID': 'mobilelistitem_5',
'SET': [{
'PATH': ['name'],
'ID': 'mobilelistitem_5',
'ATTR': '@',
'SUBSELECTOR': 'h3'
}]
}],
'requestMapping': [{
'PATH': ['X-Appery-Database-Id'],
'TYPE': 'STRING',
'HEADER': true,
'ATTR': '{database_id}'
}, {
'PATH': ['include'],
'TYPE': 'STRING',
'ATTR': 'owner'
}]
});
/code
/pre
Regards.