Q4web2py

102 views
Skip to first unread message

Henk huisman

unread,
Feb 4, 2016, 7:42:15 PM2/4/16
to web2py-users
As we are left to right readers in the western hemisphere, I want to build a form grid with variables as rows and e.g. dates as columns.
This kind of representation is very common and usefull in for example medical applications where you want to see the longitudinal results of a test.

Patient X

Test           date1    date2    date3    date4    date5      date6     date7
Hb               7,3        7,5       7,4                     8          8,3         9
HDL             4,5                                5,0               
etc         
 
In the model you would like to keep normalized  data, so Field(Patient) , Field(Date), Field(test), Field(testvalue) 


I tried SQLFORM.verysmartgrid(patienttestdata, transform(Date,7) etc but that doesn't work...LOL.

Any suggestions how to proceed?

Greetings from Bonaire



Dave S

unread,
Feb 4, 2016, 8:28:22 PM2/4/16
to web2py-users
Maybe a javascript package like Datatables or HandsOnTables?  Gives you a spread-sheet-like functionality, and you copy your row data into the appropriate cells.


/dps

pa...@cancamusa.net

unread,
Feb 8, 2016, 9:35:41 PM2/8/16
to web2py-users
You need to edit the values, no?
If the values are all numeric, then handsontable will work.
I posted one example here:

http://www.web2pyslices.com/slice/show/2042/handsontable-plugin-for-a-spreadsheet

I modified that code sample to paginate the results and a few other minor things, but you'll get the idea:

https://gitlab.com/the_pang/plugin_hotsheet/wikis/home

If you don't need to edit the values, I'd rather use a graph, and a readonly smartgrid if a table is really necessary:

http://c3js.org/samples/data_order.html
Reply all
Reply to author
Forward
0 new messages