Pass object to custom renderer

Tags: #<Tag:0x00007efc65233ad0>

Hi, I am trying to pass object to custom renderer so that I can add more feature to that cell provided in that object. Is there any way to achieve that?

https://jsfiddle.net/nihal123/uozny1xv/

Please update same if possible.

If I pass object to data: ‘firstcolumn’ it works but ones I double click on the field it shows [object object]
Is there any way to send object to renderer and also avoid this [object object] issue.

Thanks in advance

Hi @nihalshetty48

You can achieve that by disabling the default editor in the column with custom dropdown. Here is an example:

https://jsfiddle.net/aszymanski/r54pbdqy/16/

This may not work in my case. I want to pass object to other custom renderers also (Numeric and other types). If I disable I wont be able to edit that

Please correct me if I misunderstood something, but the option I sent works just for this particular column (in this case the third one) so it’s not bind to any renderer as you are defining it for any column you need to.

I want to pass object not only for customDropdownRenderer. Even for other custom Renderers like customNumericRenderer and textRenderers. Is there any other option to pass them without disabling them to avoide the [object object] issue
?/

Hi @nihalshetty48

Ok, now I see where the problem is. When the cell enters the edition mode your error - [object object] is returned by the editor, not the renderer. It happens because the editor by default is accepting only single value.

If you want to pass an object and show only particular value from that object you need to make custom editor.

If you would need help with that we can offer a consulting service. Then please contact us at support@handsontable.com