I want to mention an inconsistency in the documentation.
The docs says that the method set_col_editable accepts
a boolean value for the second parameter.
>From the source code I noticed that this is not valid.
Here is the source:
function _os3g_set_col_editable ( col, edit )
{
var attrs = this.get_col_attrs ( col );
attrs [ "os3_edit" ] = edit;
}
and in the _os3g_get_str the code is
if ( attrs [ "os3_edit" ] ) s += '
ondblclick="grid_cell_' + attrs [ "os3_edit" ] +
'_edit(this)" ';
So if I pass true in the set_col_editable the generated
code will be:
ondblclick="grid_cell_true_edit(this)"
Such a method does not exist but there is the method
grid_cell_txt_edit.
I think the method _os3g_set_col_editable should be:
function _os3g_set_col_editable ( col, edit )
{
var attrs = this.get_col_attrs ( col );
if (edit) {
attrs [ "os3_edit" ] = "txt";
} else {
attrs [ "os3_edit" ] = false;
}
}
Also, I think the type of the column is of no importance
in the current implementation.
An usefull extension would be based on the type to have
an other editor or to not allow certain characters.
For the int type for example the only allowed chars should
be "0123456789". This can be done with set_col_valid_chars
but I think this should not be necessery since the grid
can figure this out by the type.
I have a problem with the grid's headers which are not
all of the same height.
If you have some spare time have a look at:
http://mathind.csd.auth.gr:7777/hydrochem/create
and click to the "Add New Record" link.
Thanks for the component you have created.
I found it very usefull.
PS: An other extension wich requires a lot of work is
not to create
HTML code but to create DOM objects and have the grid
to handle them.