Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by satish kumar on Dec 06, 2007 04:46
open dhtmlx forum
inserting the image in to cell

hi
how can i insert the image icon in to the every cell and then after clicking the image icon i should perfom som action how can i do it
plz help me in these regard



Answer posted by Support on Dec 06, 2007 06:14
There are few ways to implement such use-case

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

b) Use "ro" excell and HTML value
                <cell><![CDATA[<a href='#' onclick='Action'>Text</a>]]></cell>
                <cell><![CDATA[<a href='#' onclick='confirmDelete("some")'>Delete Alert?</a>]]></cell>

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