my own documentation approach
First i want to say, that the grid is a fantastic piece of javascript code.
I programmed grids, like this one, now for years, but never achieved this level of quality.
Alex, I know what pain you must suffering, trying to make it work crossbrowser ( safari or opera ).
I dropped all my code and use now your grid.
There are a few things i did not understand or could not make it work, so i 'extends' the grid with my own event-handler.
My first suggestion is, instead of expanding the grid with more and more needed features: create a minimal version.
Lets say to split it into different autonomous modules. Each part work on its own and can be replaced by another code.
In fact you did it in the code, but lack of documentation everybody(at least me) loose the overview and ends up doing it hardcoded, even when there are the needed function.
I thought of following separate parts
grid renderer important is a dynamic startpoint within the myData Array , like the patch, deliver hash tables of pointer to rows and cols, like table.rows[].cells[]
event handler addEvent, removeEvent
grid shaper setColStyle, setRowStyle, resizeCol, ...
grid manipulator addRow, remowRow, addColumn, removeColumn, expandRow, expandCol, moveColumn ...
data grabber getFromXML, getFromSOAP, getFromCVS
action logger records all modifications on a grid and submits it each onchange or other event.
but after all, i spent a few day looking at your code and came to the conclusion, that a good documentation will do much more than i wish.
What i can do is write a simple php script like the phpDocumentor but for javascript.
For that reason somebody !!! (not me) has to reformat all the comments in the code to one defined standard. i suggest to use the phpDocumentor style:
/**
* blablaintro
*
* much more blabla
*/
var or function code
but any other will do, as long as it is always equal and before the code.
here a rough sketch for the php code:
grab all js files from the lib
i made a small example with the existing grid source:
http://webmail.mbn.ch/table/doc.php
adding extra markers allows to comment text by everybody like in a bb.
nb: the wiki part is a good start
I programmed grids, like this one, now for years, but never achieved this level of quality.
Alex, I know what pain you must suffering, trying to make it work crossbrowser ( safari or opera ).
I dropped all my code and use now your grid.
There are a few things i did not understand or could not make it work, so i 'extends' the grid with my own event-handler.
My first suggestion is, instead of expanding the grid with more and more needed features: create a minimal version.
Lets say to split it into different autonomous modules. Each part work on its own and can be replaced by another code.
In fact you did it in the code, but lack of documentation everybody(at least me) loose the overview and ends up doing it hardcoded, even when there are the needed function.
I thought of following separate parts
grid renderer important is a dynamic startpoint within the myData Array , like the patch, deliver hash tables of pointer to rows and cols, like table.rows[].cells[]
event handler addEvent, removeEvent
grid shaper setColStyle, setRowStyle, resizeCol, ...
grid manipulator addRow, remowRow, addColumn, removeColumn, expandRow, expandCol, moveColumn ...
data grabber getFromXML, getFromSOAP, getFromCVS
action logger records all modifications on a grid and submits it each onchange or other event.
but after all, i spent a few day looking at your code and came to the conclusion, that a good documentation will do much more than i wish.
What i can do is write a simple php script like the phpDocumentor but for javascript.
For that reason somebody !!! (not me) has to reformat all the comments in the code to one defined standard. i suggest to use the phpDocumentor style:
/**
* blablaintro
*
* much more blabla
*/
var or function code
but any other will do, as long as it is always equal and before the code.
here a rough sketch for the php code:
grab all js files from the lib
serach and replace all "{" width "<div class='expander' onclick='toogle(this.nextSibling)'>{</div>"
serach and replace all "}" width "</div>"
search and replace all "/**\n" width "<div class='comment'>";
search and replace all "*/\n" width "</div><div style='float:right;'>[commentImage]</div>";
etc.
maybe js search functionality...
i made a small example with the existing grid source:
http://webmail.mbn.ch/table/doc.php
adding extra markers allows to comment text by everybody like in a bb.
nb: the wiki part is a good start
Andres Obrero [Winterthur]
March 15,