Battling the TableGrid-Beast

37 views
Skip to first unread message

Wolfgang Hübner

unread,
Jun 16, 2012, 4:36:29 PM6/16/12
to mytab...@googlegroups.com
Hi,

i am currently battling the TableGrid to make it useful for local data that is not mirrored in a database but is held inside an array of the browser. The things I managed are:

  1. Upgraded code to work with prototype 1.7. Removed "var self=this" in TableGrid.js and used proper binding instead.
  2. Sorting works without remote url. Currently only a simple sort via < and > is done across the elements.
  3. The modification markers remain after sorting. I extended this.modifiedRows so it holds Objects in a form of { rownumber, [ modifiedCellId, modifiedCellId, ...]} for this purpose.
  4. A heavy bug inside _applyHeaderButtons removed: "element.observe("click"...)" was called inside "element.observe("mousemove"...)", thereby flooding the header with "click"-observers everytime the mouse ran over it. I am removing the "click"-handlers inside now before adding new ones.

Still unchecked:

  1. Pager

Still broken:

  1. Adding and deleting columns. This is going to be really tricky, since the TableGrid keeps track of deleted and added cells in extra arrays. Sorting is going to be fun....


Pablo Aravena

unread,
Jun 16, 2012, 10:23:43 PM6/16/12
to mytab...@googlegroups.com
Hi Wolfgang

That is excellent, did you check out the source code from github?

Currently, I'm rewriting the code in coffeescript and jquery but still
not getting to TableGrid.js part.

Thanks a lot for your help

Regards
Pablo
> --
> You received this message because you are subscribed to the Google Groups
> "MyTableGrid" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mytablegrid/-/IDL9F4MBiwUJ.
> To post to this group, send email to mytab...@googlegroups.com.
> To unsubscribe from this group, send email to
> mytablegrid...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mytablegrid?hl=en.

Wolfgang Hübner

unread,
Jun 19, 2012, 2:47:38 PM6/19/12
to mytab...@googlegroups.com
Hi.

Yes, I made a fork on Github. I cannot check my code back to the fork... seems I don't really understand GitHub ^^ Maybe files are locked or need your approval?

Anyway, news on the progress:
  1. The table headers work correctly with IE now. (Stupid IE fires the events "mousemove" and "click" simultaneously *siiigh*)
  2. Sorting on local data keep the "new cell" markers.
  3. Inserted cells are automatically marked with "new cell" markers for each cell ... and that's why the "save"-Button works correctly now ;-)
  4. Keeping the page of the pager when a sort is executed on DB/Backend data.
  5. Shifted the localization of the Date-Fields from Date.js to i18n.js.

What I'm about to do next:

  1. Installing an option to make the first row "fixed". That will be tricky, since I have to render this row outside the table so it stays visible, but synchronize its vertical scrolling with the table. 
  2. Adding a filter field. I'll start with a primitive one without "filtering while you type".

I'll keep you informed on how it went. Best wishes,

Wolfgang

> mytablegrid+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages