I'd like "txt" coltype behavior while displaying an icon.

Hi, I’m new to dhtmlxGrid, please bear with me. (But I did look and didn’t see an obvious answer in the forums)

One of the columns in my grid is a long text area. If I set the colType to “txt”, I get the behavior I want. However, I don’t really want to present the user with some characters of text in the column. Instead, I’d like to present them with icons; one to signify there is no data in that column, and a different one to indicate there is some data.

The user should be able to click on the icon, and get the same (or better) edit experience that they get with the “txt” data type.

The only way I see to present an icon is to use an “img” type for the column. However, if I do that I have to add a javascript invocation to the “img” data, then roll my own popup, etc. to get the edit capability. I’d rather use the libraries existing capabilities especially since it’s already tied into the data management, etc.

Is there any way to do this?

My thoughts, although I don’t know how to achieve them:

  1. Could I use an “img” column to display my icon, and put the data in a Hidden “txt” column. Code a function which just unhides that one cell and brings it up in the normal txt editor?

  2. Use the “txt” column normally, but change the style of the column to show my icons instead of the cells data? (How might I do that, I don’t see a way to directly change the style of a single cell. Also, when do I do that, at grid-load I presume, just loop through each row? )

  3. I could display the long text as a sub_row, however it needs to be editable. It seems to me that the content of the sub-row is html, so I could create my own code, but then again I’m doing it myself instead of using the native capability.

  4. Any other ways?

Thanks for any and all suggestions. Steve.

a) you can use any html inside of non-editable cells

<![CDATA[ ]]>

b) if you need to catch the click on some specific cell you can use

grid.attachEvent("onRowSelect", function(id, index){ if (index == INDEX_OF_BUTTON_COLUMN) do_some(id); })

c) you can store data in hidden column, or in user data, and access it through API.

d) check article about custom excell creation
docs.dhtmlx.com/doku.php?id=dhtm … le_excells