First, thanks for all your work on Brython -- it's really great!
(Especially for those of us who get hives from trying to
write javascript! ;)
I need a powerful grid widget and there are several native
js candidates, of which the one I'm experimenting with first
is SlickGrid:
https://github.com/mleibman/SlickGrid/wiki
(The SlickGrid project is currently on hold, but even so
its current functionality is quite impressive.)
I'm in the process of converting the SlickGrid examples to
brython. I've attached my code for the second example,
which I now have working. It demonstrates cell formatters.
The attached files are:
* sg2.html ..... the original SlickGrid example 2
* sg2b.html .... html file for the Brython version
* sgex2.py ..... python script for " "
As you can see from the python code, I reimplemented the
formatter functions (which are used in the 'columns' data
structure, which gets passed to the Slick.Grid constructor
function) in python -- that part was trivial but I only
did it after trying and failing at using the js
'Slick.Formatters...' functions.
The two ways I tried using the Slick.Formatters
functions were:
(1) Just insert them from the 'window.Slick.Formatters...'
namespace and hope brython does the right thing ...
in that case I get a js stack trace and:
"Traceback (most recent call last):
RuntimeError: TypeError: klass is undefined"
(2) Use JSConstructor on them (even though they are not
constructors! ;) -- this at least does not give an error,
but the functions don't work (cells are not formatted).
Do you know of any way that the SlickGrid formatter
functions could be used directly -- i.e., without having
to reimplement them as python functions? Those functions
are extremely simple, but I'd like to know in case I
encounter more complex functions that would require real
work to reimplement.
Thanks,
Steve