Adding Images

I want to add Edit & Delete images in the Edit & Delete Column.

I have loaded the data from xml file. I also added the code to add images but somehow the images is not displaying.

Please look at the code below.

<div id="1" style="width:800px;height:200px;overflow:auto">


    var table = new AW.XML.Table;

    var obj = new AW.Grid.Extended;
    var str = new AW.Formats.String;
    var num = new AW.Formats.Number;


    obj.setCellFormat([str, str, num, num, num]);

    //	provide cells and headers text

    //	set number of rows/columns

    //	enable row selectors
    obj.setSelectorText(function(i){return this.getRowPosition(i)+1});

    //	set headers width/height




    //obj.setCellLink(function(i, j){ return "http://www.mysite.com?i="+i+"&j="+j; }, 5);    // set data  
    //obj.setCellTemplate(new AW.Templates.Link, 5);    // and template  
    //obj.setCellLink(function(i, j){ return "http://www.mysite.com?i="+i+"&j="+j; }, 6);    // set data  
    //obj.setCellTemplate(new AW.Templates.Link, 6);    // and template  
    for (var i=0; i<obj.getRowCount(); i++)
        obj.setCellText("<img src='editicon.gif' BORDER='0'>", 6, i);
        obj.setCellText("<img src='delicon.gif' BORDER='0'>", 7, i);  
April 26,
In your obj.setCellText, try making the source the full path (http://www.domain.com/imdex/editicon.gif - or something like that). I'm using something like this (but a little differently) and it works fine.

Hope it helps.
April 29,

This topic is archived.

See also:

Back to support forum