formslib and tables (Moodle 2.0)

formslib and tables (Moodle 2.0)

by Howard Miller -
Number of replies: 5
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Is there any way of building a table using formslib. I need an n x n grid of text boxes with column and row headings. The nearest I can get is to use Groups for each row but that doesn't give me the headings.

I suspect I am coding this the old-fashioned way, but thought I would ask.
Average of ratings: -
In reply to Howard Miller

Re: formslib and tables (Moodle 2.0)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I think you are right. Now way to do this in formslib.

What are you actually trying to do?

In reply to Tim Hunt

Re: formslib and tables (Moodle 2.0)

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

you might be able to manage it using CSS - I've got some code that displays a list of course categories using formslib that has various checkboxes beside each course category - here's the code that builds the formslib stuff:
http://git.catalyst.net.nz/gw?p=moodle-block_cam_mycourses.git;a=blob;f=displaycategories_form.php;h=5b03ca973b33016f223e64f5e9fe9efea4881df6;hb=df8539047587e1896ad849fd45ab934b23445116

and here's the CSS:
http://git.catalyst.net.nz/gw?p=moodle-block_cam_mycourses.git;a=blob;f=styles.css;h=9c04329ca7aa3ecc9812f44be2394f5bdecce187;hb=df8539047587e1896ad849fd45ab934b23445116

hope that helps!

In reply to Tim Hunt

Re: formslib and tables (Moodle 2.0)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It's literally filling in a matrix of values. Something like the Gradebook grader screen only much simpler. Of course, I should go and see how that was done smile
In reply to Howard Miller

Re: formslib and tables (Moodle 2.0)

by Frank Ralf -
Hi Howard,

Some of the information and techniques from User:Frank_Ralf/Moodle_forms3 might come in useful.

hth
Frank
In reply to Frank Ralf

Re: formslib and tables (Moodle 2.0)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It sounds like the answer is - sort of yes, but some tricky CSS will be required.

Thanks for the pointers smile