I've jumped in the deep end of module dev by trying to hack a contrib module. I've learned a lot by dissecting almost every line of code. The module (tablefield) basically just creates a new CCK type and widget of type table so you can have a grid of data within a node. Pretty simple, it allows you to import a CSV file and has a button to rebuild the table adding either rows or columns. I've added a new button to swap the bottom row (when you add a new row it creates a blank at the bottom) to the second row (1st row is always the header). This would allow data to be added to the top of the table instead of having to copy/paste current data down each row. A cheap way to sort, I know.
I'm very close to solving this, have the data working and all, but it's just not being rendered. I can see the $element that is passed to the theme function, and the only thing that does not get updated is the #children attribute. My array data that I manipulated is there. How do I get the #children to update/rebuild? I'm assuming it has something to do with a callback to $form or $form_state?
Any clue would be appreciated, thanks!
