What is the problem? Please be detailed.
I have a survey and a table with data on villages and a linked table in which i enumerate households in each village. I use ODK-X-tables to show a list of villages and when I click on one, it should move on to a list of households. I’ve been following the HOPE example and made sure that by clicking on a village one is taken to the _list view of the households in that village:
function handleClick(comId) {
if (!$.isEmptyObject(networksCommunity)) {
odkTables.openTableToListView(null,
'networksHouseholdList',
'comId = ?',
[comId],
'config/tables/networksHouseholdList/html/HouseholdList_list.html');
}
}
So far this works like charm. However, my code on the sub view (HouseholdList_list.html) needs to use the comId that it was called from (to add a button that allows users to add new households). How to I read that information from within HouseholdList_list.html?
What ODK tool and version are you using? And on what device and operating system version?
ODK Survey 2.1.8
ODK Tables 2.1.8
What you have you tried to fix the problem?
Also adding the ComId to the path, like: ‘HouseholdList_list.html?comId=’+comId. But this is a hacky solution that is bound to cause problems.
I’ve also tried reading the ComId from the objects in the returned table in the subview, but that fails when the list is empty.