How to Change dynamically the render [HTML code] of a cell in a grid panel

  1. #1

    How to Change dynamically the render [HTML code] of a cell in a grid panel

    Hi everybody,

    I'm on 0.7 and I just want to change dynamically the render [HTML code] of a cell in a grid panel.
    In my case, I have a gridPanel with one column containing an icon.

    //javascript
    var WarnRender = function(value,store,record) {
              return '<img style="cursor:pointer;" src="../Images/cross_gray.gif" />';
    		}
    And when i click on the cell, I want to do something like :
    cell.innerHtml = '<img style="cursor:pointer;" src="../Images/cross_gray.gif" />'. to switch the icon inside the cell.

    Is it possible or am I dreaming awake...
  2. #2

    RE: How to Change dynamically the render [HTML code] of a cell in a grid panel

    Hi*mamadou.ba,

    It appears your renderer should work as is. What exactly is happening when you run that code?


    Geoffrey McGill
    Founder
  3. #3

    RE: How to Change dynamically the render [HTML code] of a cell in a grid panel

    Oups in my cellClick function
        
    
    var gpLogRequest_CellClick = function(grid, rowIndex, columnIndex, e){
    
                var t = e.getTarget();
    the parameter t contains my cell...

    and with
        
    t.outerHTML = '.....
    I can do it...
    My bad,
    and thank you for your quick answer...


Similar Threads

  1. [CLOSED] Change cell color for grid panel using editablegrid plugin
    By AnulekhaK in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 10, 2014, 4:43 AM
  2. Render html in gridpanel cell?
    By Tbaseflug in forum 2.x Help
    Replies: 1
    Last Post: May 17, 2012, 2:52 PM
  3. Replies: 1
    Last Post: Oct 19, 2011, 7:14 AM
  4. [CLOSED] Trying to dynamically change grid panel columns.
    By GLD in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 29, 2011, 8:41 AM
  5. Replies: 2
    Last Post: Jun 14, 2010, 1:34 PM

Posting Permissions