Jump to content

Get header Title of DBGrid


nandrianakis

Recommended Posts

function viewready(sender, eOpts)

{  

  sender.getColumns()[0].renderer = function (value, metadata, record ) 

  {    

    myToolTipText = "<table class='tblRecGridRowToolTip'>";

    for (i=0;i< sender.getColumns().length;i++)            

    {

       myToolTipText=myToolTipText+"<tr class='tdToolTip'>"+

                      "<td class='tblRecGridRowToolTipTitle'><b>HEADER</b></td>"+

                      "<td class='tblRecGridRowToolTipValue'>"+record.get(i)+"</td>"+

                     "</tr>";   

    }     

    myToolTipText=myToolTipText+ "</table>"; 

    metadata.tdAttr = 'data-qclass="dvQtip" data-qtip="' + myToolTipText + '"';

    alert(myToolTipText); 

    return value;

  };  

  sender.getView().refresh();      

}

 

I want to replace the word HEADER with columns header

Rgs

Link to comment
Share on other sites

Yes 

 

 

This fn

 

function viewready(sender, eOpts)

{

 

  sender.getColumns()[0].renderer = function (value, metadata, record ) 

  {    

    myToolTipText = "<table class='tblRecGridRowToolTip'>";

    

    for (i=0;i< sender.getColumns().length;i++)            

    {

       myToolTipText=myToolTipText+"<tr class='tdToolTip'>"+

                      "<td class='tblRecGridRowToolTipTitle'><b>"+sender.getColumns().text+": </b></td>"+

                      "<td class='tblRecGridRowToolTipValue'>"+record.get(i)+"</td>"+

                     "</tr>";   

    }     

    myToolTipText=myToolTipText+ "</table>"; 

    metadata.tdAttr = 'data-qclass="dvQtip" data-qtip="' + myToolTipText + '"';

   

    return value;

  };

  

  sender.getView().refresh();   

 

}

  


It not works for some grids even for some records on the same grid

Any idea?

Link to comment
Share on other sites

  • 11 months later...

How can i SET the title from specified column at runtime with js?

 

I tried to use

     MyGrid.Columns[n].Title.Caption := 'New Title';

before to open dataset but non working ....

Delphi Rio

uniGUI version 1.90.0.1498

 

 

 

Link to comment
Share on other sites

6 hours ago, azago said:

I tried to use

     MyGrid.Columns[n].Title.Caption := 'New Title';

before to open dataset but non working ....

Hi,

Columns are created "dynamically"?

Can you make a simple testcase for this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...