Quote from: perlmonger at Sep 11, 2006, 04:12 PM
I started to look at the Make Table snippet but got side-tracked and went with datagrid since I could get something up quickly. Do you have any information that you care to share about the Make Table snippet? (examples, code, etc) What I really want is something similar to the data grid widget available in most current Javascript libraries like OpenRico, Dojo, etc. Something that has the option of scrolling, sortable columns, edit in place, add record (if logged in), delete record (if logged in), etc. Yeah, I want it all.... never hurts to want I guess. I think I’ll try to implement something from OpenRico or Mochikit or something like that. Now I’m going to have to spend countless hours test-driving Javascript libraries to decide which one to use. I haven’t experimented much with these yet, just played with prototype and scriptaculous to date. Once again, if anyone has been successful with what I’m trying to do, please shout it out.
Thanks samba.
Perl,
Fascinating ideas! Yes, to get something up quick, Datagrid is the one.
Let’s see about MakeTable, based on your wish list...
There is javascript stuff that allows you to change the "# of records displayed". I disabled that for my app - won’t really be useful because not an enormous # of recs. Nothing for scrolling per se, if I recall.
Sortable columns, yup, you tell which columns you want to display and which ones to sort.
So far, I don’t think there are add/delete/change capabilities in there, strictly display and re-sort. [there seems to be planned code in Datagrid for sorting, but I don’t think it ever got implemented, so I just took care of that with ORDER BY clauses].
OK... here’s a recap of what I did to MakeTable. Lots of care and feeding! PM me if you need details.
In the Snippet:
- I changed it to be fed by a URL parm for part of the query.
- I hardcoded the maxPageSize.
- I tweaked the main query for my purposes including use of my parm.
- I also tweaked the query used for pagination to use the parm.
- I chose the fields to display.
- I added my parm to the qualifier for OrderByLink.
- I selected which fields to sort on.
- I added the parm to the createPagingNavigation part (a gotcha!).
In the Class:
- I commented out the Javascript stuff for "# or records" choice.
- I added CSS classes to a few things for display tweaking.
- I found there were bunches of CSS ID’s and classes that needed to be added to my template; there was no CSS example provided with the class and snippet. This is a gotcha that you see when the table looks kind of plain.
- in the OrderByClause I set up a default sort order. [It would be nice to simply set this from the snippet].
- I changed a line of code to work
without friendly URL’s. See 2nd find on "documentIdentifier".
You may not want to do all that!
OpenGeek is the guy who wrote MakeTable, and he can speak with the most authority on it. If you’re really interested in MakeTable, perhaps a new thread is warranted, or a PM to OpenGeek. He’s a very smart fellow.