0
votes

I have given tooltip to table header like: By adding if( cm.title != undefined ) {$(th).attr('title', cm.title);} in flexgrid.js file under the col model itreration

if (p.colModel) {
        thead = document.createElement("thead");
        var tr = document.createElement("tr");
        for (var i = 0; i < p.colModel.length; i++) {
            var cm = p.colModel[i];
            var th = document.createElement("th");
            th.innerHTML = cm.display;
            if( cm.title != undefined ) {$(th).attr('title', cm.title);}
            if (cm.name && cm.sortable)
                $(th).attr("abbr", cm.name);
            $(th).attr("axis", "col" + i);
            if (cm.align)
                th.align = cm.align;
            if (cm.width)
                $(th).attr("width", cm.width);
            if ($(cm).attr("hide"))
                th.hidden = true;
            if (cm.process)
                th.process = cm.process;
            $(tr).append(th)
        }
        $(thead).append(tr);
        $(t).prepend(thead)
    }

And Use Like :

colModel : [
                { display: 'Tender No', title: 'tbgNo', name : 'tbgNo', width : 200, sortable : true, align: 'left',}

So, How can we add tooltip to Table cell./

2

2 Answers

0
votes

You can use element.setAttribute("title","message tool-tip you want");

0
votes

Hello after R & D lots I found one best result which are working in all situation. We can give tooltip to flexgrid cell by using span title at where we populate the grid Please look into this code.

if(!(jsonobj ==null)){
                for(var i=0; i < jsonobj.list.length; i++){
                rows.push({  cell: 
                    [
                     "<span title='"+jsonobj.list[i].tbgNo+"'>"+checkforUndefined(jsonobj.list[i].tbgNo)+"</span>",
                     "<span title='"+jsonobj.list[i].title+"'>"+"<A HREF=javascript:showCodes("
                        + jsonobj.list[i].id
                        + ")>"
                        + jsonobj.list[i].title
                        + "</A> "+"</span>",
                        checkforUndefined(jsonobj.list[i].startDate)
                    ] 
                });
                } 

Thanks..