Welcome Guest Search | Active Topics | Sign In | Register

How to Show Tooltip Mouse Over on Cell Options
Nrd
Posted: Wednesday, January 25, 2012 8:49:31 AM
Rank: Newbie
Groups: Member

Joined: 2/27/2011
Posts: 8
I want to show tooltip on mouse over on grid Cells. I am trying to use ClientSideOnCellOver property
But no result ...
Can any one have suggestion on this .
Here is the Grid Code:-
<eo:Grid runat="server" ID="eoGrid1" BorderColor="#828790" BorderWidth="0px" GridLines="Both"
FixedColumnCount="0" ColumnHeaderDescImage="00050205" GridLineColor="240, 240, 240"
Width="100%" ColumnHeaderAscImage="00050204" ColumnHeaderHeight="20" Font-Size="10pt"
Font-Names="Tahoma" FullRowMode="true" EnableTheming="true" EnableKeyboardNavigation="True"
Height="100" ScrollBars="both" AllowColumnReorder="False" ItemHeight="22" IsCallbackByMe="False" RunningMode="client" ColumnHeaderDividerImage="00050103"
ClientSideOnCellOver="ClientSideOnCellOverhandler">
<cloumns>
..
..
..
</columns>
</eo:Grid>
<script type="text/javascript">
function ClientSideOnCellOverhandler(grid, cell, changed, e) {
alert('I am here!');
}
</script>

NRD
Software Engineer
eo_support
Posted: Wednesday, January 25, 2012 9:44:15 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

There are basically two ways to do the tooltip: to position a separate DIV right above the grid cell; or render an element inside the grid cell with a "title" property.

The first method would be implemented completely outside of the Grid. You would put a separate DIV in your page with a high z-order, then absolute position that DIV either based on your mouse position or the cell position when mouse is over the cell. The client side GridCell object provides getDOMElement method for you to get the DHTML element for the grid cell:

http://www.essentialobjects.com/doc/1/jsdoc.public.gridcell.getdomelement.aspx

You can then get the position of this DHTML element and use it as a reference point to position your tooltip DIV. This method gives you to ultimate flexibility because it allows you to fully customize both the style and the content of your DIV.

An easier method is to render an element with "title" attribute inside the grid cell. For example, instead of setting a cell's value to "abc", you can set it to "<div title='this is the tooltip'>abc</div>". If your tooltip is always the same as your content you can even set the GridColumn's DataFormat to something like "<div title='{0}'>{0}</div>" so that the Grid does the formatting for you automatically. This method is easier but sometimes it has serious side effects --- for example, if you have code that needs to use a cell's Value as input, then you must manually trim the outer DIV off.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
Nrd
Posted: Tuesday, January 31, 2012 9:14:16 AM
Rank: Newbie
Groups: Member

Joined: 2/27/2011
Posts: 8
Hi
I achive tooltip (on Eo grid cell title) using "<div title='{0}'>{0}</div>" as you suggested Looking nice. But how do i show full lenght of Value on tooltip if cell having more then 500 char . Any Idea.
OR
How do i impliment The client side GridCell object provides getDOMElement method http://www.essentialobjects.com/doc/1/jsdoc.public.gridcell.getdomelement.aspx
can you give me a example.



NRD
Software Engineer
eo_support
Posted: Tuesday, January 31, 2012 9:50:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

We can only give you this:

Code: JavaScript
function ClientSideOnCellOverhandler(grid, cell, changed, e) 
{
     //Get the cell element
    var cellElement = cell.getDOMElement(); 

    //Get cellElement's page position
    .....

    //Position your tooltip DIV according to cellElement's position
    ....

    //Set tooltip DIV's content
    ....
}


Only the first part is provided to us. You will need to have your own code to get the element's position, positioning your DIV and set your DIV's content. Those are beyond what the product does so is also beyond the scope of the support.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.