Subclassing eXcell_tree formatter

I have a need for a treegrid where the tree column (first column) is generated by a custom formatter - in my case it is a text for the link.

I know how to use custom formatter’s for columns, but cannot do so in the case of the ‘tree column’ as it needs the +/- expand behavior.

So, rather than generating the html into the treegrid’s raw data, I want to simply create a custom formatter that extends eXcell_tree. I tried doing this in the ususal javascript syntax (a new class with prototype set to eXcell_tree) but now the treegrid fails with errors!

What am I missing, and why can’t I simply extend an existing custom cell formatter and enhance its behavior?

I did find this technique for subclassing eXcell_tree, but I need to know this is ‘acceptible practice’ and correct (read easily maintained for future releases) development practice.


You can’t subclass “tree” excell, but you can redefine existing logic through external js file, so including such file on page will change logic of tree-cell in all treegrids on the page.

===== some.js ======
eXcell_tree.prototype.setValue = function(valAr){
/* here you can copy logic from dhtmlxtreegrid.js and alter it in the necessary way */

While such solution is far from perfect, it allows to have the custom treegrid excell rendering and be able to enable | disable it when necessary. ( also , it must not have any problems during version upgrade )