Rendering Lists in ODK Tables

Hello All,
I am playing around with ODK Tables this weekend, and am baffled at how to
create a List view similar to patients_list.html. When in Tables, in the
Patients table, I am given the option of multiple views, graph, map, list
and spreadsheet. When I click on list view, I get a nice HTML/JS list view.

When I attempt to create my own table called Villages, as well as a
village_list.html, I still do not get the option of a list view, when
trying to choose different views I can view my table. How do we create list
views, and how do we call them (i.e how can I go from a button in
homescreen.html to a bespoke list view, or from a spreadsheet view to a
list view?

Thanks in advance,
Tumaini

Hi Tumaini,

Thanks for using Tables! Questions like this will help us make it clearer
in the future.

If you've modeled the list view after the patients_list.html it sounds like
you're on the right track. Tables doesn't rely on any sort of naming
convention to find the appropriate list view. Instead you have to set it,
which you do via the List View Manager. This allows you to have several
list views for a single table if you want to display different sorts of
information. To get to the List View Manager, open the table in question,
click the gear in the top right corner, and select "List View Manager" from
the drop down menu. This will give you the option to add a list view. Click
the plus in the top right hand corner, click "Name" to rename the list
view, and then "File" to choose your html file. (You have to have OI File
Manager installed to do this.) When you return to the List View Manager you
should now see it listed. Clicking on it will open the table and display it
using the given file. Selecting the bullet point sets the default list
view--this is the one that will open when you select "List" from the view
menu (the place we're you're seeing Spreadsheet, List, Graph, Map).

Let me know if something doesn't work as I've explained or is confusing.
Hopefully it will make sense with the device in your hand.

As for opening files from within the html--the simple "openTable" methods
you see in the examples open the given table in the view that was last
selected. This means you can open up your html files, click through to the
different tables, selecting the view (e.g. spreadsheet, list) to what you
want, and in the future it will continue to open in that setting.

If you want more control over which files are used to display the tables
(e.g. if a certain button always opens a list view, another always a map
view), have a look at the methods here:

https://code.google.com/p/opendatakit/source/browse/src/org/opendatakit/tables/views/webkits/ControlIf.java?repo=tables

These are the functions that are available on the "control" object in the
html/javscript. Of particular note are the methods named things like
"openTableToListViewWithFile", which allows you to open the given table to
a list view using a file that you specify. The one that gets you to a
spreadsheet view is "openTableToSpreadsheetView".

Two other places to look are the "data" objects you have access to in the
html. List views have a data object with these methods:

https://code.google.com/p/opendatakit/source/browse/src/org/opendatakit/tables/views/webkits/TableDataIf.java?repo=tables

while detail views have a "data" object with the following methods:

https://code.google.com/p/opendatakit/source/browse/src/org/opendatakit/tables/views/webkits/RowDataIf.java?repo=tables

You have a "control" object available in all of your html files.

The final part of your question was how to you go from spreadsheet view
back to a list view. The spreadsheet view doesn't display any html, so the
only way to do this is through the menu button at the top--select the lined
piece of paper icon and in the drop-down menu containing "Spreadsheet,
List, Graph, Map" select your preferred view.

Let me know if any of this wasn't clear or isn't working the way I
described, if you have any additional questions, or find yourself wanting
functionality we currently don't support. I'm happy to try and help.

Sam

Hello All,
I am playing around with ODK Tables this weekend, and am baffled at how
to create a List view similar to patients_list.html. When in Tables, in the
Patients table, I am given the option of multiple views, graph, map, list
and spreadsheet. When I click on list view, I get a nice HTML/JS list view.

When I attempt to create my own table called Villages, as well as a
village_list.html, I still do not get the option of a list view, when
trying to choose different views I can view my table. How do we create list
views, and how do we call them (i.e how can I go from a button in
homescreen.html to a bespoke list view, or from a spreadsheet view to a
list view?

Thanks in advance,
Tumaini

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.

ยทยทยท On Sun, Oct 13, 2013 at 12:23 PM, Tumaini Kilimba wrote: > For more options, visit https://groups.google.com/groups/opt_out.
1 Like

Hello Sam,
Thanks alot for the detailed an thorough explanation, will give it a try
and let you know. Am very excited about Tables, and am impressed at the
work thats gone into it!

ยทยทยท On 15 Oct 2013 09:44, "Sam Sudar" wrote:

Hi Tumaini,

Thanks for using Tables! Questions like this will help us make it clearer
in the future.

If you've modeled the list view after the patients_list.html it sounds
like you're on the right track. Tables doesn't rely on any sort of naming
convention to find the appropriate list view. Instead you have to set it,
which you do via the List View Manager. This allows you to have several
list views for a single table if you want to display different sorts of
information. To get to the List View Manager, open the table in question,
click the gear in the top right corner, and select "List View Manager" from
the drop down menu. This will give you the option to add a list view. Click
the plus in the top right hand corner, click "Name" to rename the list
view, and then "File" to choose your html file. (You have to have OI File
Manager installed to do this.) When you return to the List View Manager you
should now see it listed. Clicking on it will open the table and display it
using the given file. Selecting the bullet point sets the default list
view--this is the one that will open when you select "List" from the view
menu (the place we're you're seeing Spreadsheet, List, Graph, Map).

Let me know if something doesn't work as I've explained or is confusing.
Hopefully it will make sense with the device in your hand.

As for opening files from within the html--the simple "openTable" methods
you see in the examples open the given table in the view that was last
selected. This means you can open up your html files, click through to the
different tables, selecting the view (e.g. spreadsheet, list) to what you
want, and in the future it will continue to open in that setting.

If you want more control over which files are used to display the tables
(e.g. if a certain button always opens a list view, another always a map
view), have a look at the methods here:

https://code.google.com/p/opendatakit/source/browse/src/org/opendatakit/tables/views/webkits/ControlIf.java?repo=tables

These are the functions that are available on the "control" object in the
html/javscript. Of particular note are the methods named things like
"openTableToListViewWithFile", which allows you to open the given table to
a list view using a file that you specify. The one that gets you to a
spreadsheet view is "openTableToSpreadsheetView".

Two other places to look are the "data" objects you have access to in the
html. List views have a data object with these methods:

https://code.google.com/p/opendatakit/source/browse/src/org/opendatakit/tables/views/webkits/TableDataIf.java?repo=tables

while detail views have a "data" object with the following methods:

https://code.google.com/p/opendatakit/source/browse/src/org/opendatakit/tables/views/webkits/RowDataIf.java?repo=tables

You have a "control" object available in all of your html files.

The final part of your question was how to you go from spreadsheet view
back to a list view. The spreadsheet view doesn't display any html, so the
only way to do this is through the menu button at the top--select the lined
piece of paper icon and in the drop-down menu containing "Spreadsheet,
List, Graph, Map" select your preferred view.

Let me know if any of this wasn't clear or isn't working the way I
described, if you have any additional questions, or find yourself wanting
functionality we currently don't support. I'm happy to try and help.

Sam

On Sun, Oct 13, 2013 at 12:23 PM, Tumaini Kilimba tkilimba@ihi.or.tz wrote:

Hello All,
I am playing around with ODK Tables this weekend, and am baffled at how
to create a List view similar to patients_list.html. When in Tables, in the
Patients table, I am given the option of multiple views, graph, map, list
and spreadsheet. When I click on list view, I get a nice HTML/JS list view.

When I attempt to create my own table called Villages, as well as a
village_list.html, I still do not get the option of a list view, when
trying to choose different views I can view my table. How do we create list
views, and how do we call them (i.e how can I go from a button in
homescreen.html to a bespoke list view, or from a spreadsheet view to a
list view?

Thanks in advance,
Tumaini

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google
Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.