HTML button/image in a cell

Hi,



we’ve just purchased the Pro version of dhtmlXGrid and we have a question:

We want to have edit/delete/select/etc. functions for the records represented by rows of the grid (not in place editing).

So what we need to do is put some buttons or image icons in a column of the grid with links to pages or javascript functions. But how?



Creating CDATA HTML code inside a cell gives us all kinds of errors with quotation marks when putting that in the sourcecode of the page via PHP.



Is there an easy way to create a new exCell type button and use that as column.



Thanks in advance

Joachim Kathmann, i22.de GmbH

Actually solution with CDATA is most simple one but threre are some other ones

There are multiple ways to provide javascript actions from cell

a) Use “link” excell and formated data
                Text^javascript:Action^_self
                Delete Alert?^javascript:confirmDelete(“some”)^_self
such code will create an A tag, with javascript action attached to it

b) Use “ro” excell and HTML value
                <![CDATA[Text]]>
                <![CDATA[Delete Alert?]]>

c) Use the setOnRowSelectHandler method
    grid.setOnRowSelectHandler(my_func,true);
    function my_func( rowId, cellIndex){
        if (cellIndex==some_index)
            confirmDelete(“some”)
    }

d) create a custom excell


If necessary I can provide a sample.

Thank you for your answer!
Meantime I figured out how to use the “img” celltype with a link on the image. Seems not being documented. I just found it mentioned that img in cells can have an optional link, and in celltype link description it’s stated that link parameters use a “^” as delimiter so I tried that with the img definition and it worked. So my button definition is something like:

'images/ico_edit.gif^Edit^index.php?op=edit^_self’

img url^alt text^link url^link target

Please add that to the docs.

Greetings
J. Kathmann