formslib and tables (Moodle 2.0)

formslib and tables (Moodle 2.0)

Howard Miller -
回帖数:5
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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.
回复Howard Miller

Re: formslib and tables (Moodle 2.0)

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

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

What are you actually trying to do?

回复Tim Hunt

Re: formslib and tables (Moodle 2.0)

Dan Marsden -
Core developers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Plugins guardians的头像 Testers的头像 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!

回复Tim Hunt

Re: formslib and tables (Moodle 2.0)

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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 微笑
回复Howard Miller

Re: formslib and tables (Moodle 2.0)

Frank Ralf -
Hi Howard,

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

hth
Frank
回复Frank Ralf

Re: formslib and tables (Moodle 2.0)

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

Thanks for the pointers 微笑