Cell value hover tooltip : ListGrid Renderer « SmartClient « JavaScript DHTML






Cell value hover tooltip

 
<!--
Isomorphic SmartClient
Copyright(c) 1998 and beyond Isomorphic Software, Inc.
"SmartClient" is a trademark of Isomorphic Software, Inc.
All rights reserved.

Open Source License

SmartClient source code, located under the source/ directory, and the resulting assembled modules 
in isomorphic/system/modules/, as well as JavaScript and CSS files under the isomorphic/skins directory are 
licensed under the terms of the GNU Lesser General Public License, version 3. 
The text of the LGPLv3 license is available online at http://www.gnu.org/licenses/lgpl-3.0.html

If your project precludes the use of this license, or if you'd like to support SmartClient LGPL, 
we encourage you to buy a commercial license.

Icon Experience Collection

Selected 16x16 icons within the isomorphic/skins directory are part of the Icon Experience collection 
(http://www.iconexperience.com) and may be freely used with any SmartClient components without charge, 
but may not be used as part of screen designs separate from SmartClient components without a purchase 
of a license from Icon Experience. We are working to replace these icons as soon as possible.

All other media found under the isomorphic/skins directory may be used under the LGPLv3.

Commercial Licenses

A number of commercial licenses are available for purchase. Please see http://smartclient.com/license.

Warranty Disclaimer

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even 
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General 
Public License for more details.

Copyright 2001 and beyond Isomorphic Software, Inc. Last revised July 20, 2008. 


-->

<!-- The following code is revised from SmartClient demo code(SmartClient_70rc2_LGPL.zip).-->



<HTML><HEAD>
  <SCRIPT>var isomorphicDir="isomorphic/";</SCRIPT>
    <SCRIPT SRC=isomorphic/system/modules/ISC_Core.js></SCRIPT>
    <SCRIPT SRC=isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
    <SCRIPT SRC=isomorphic/system/modules/ISC_Containers.js></SCRIPT>
    <SCRIPT SRC=isomorphic/system/modules/ISC_Grids.js></SCRIPT>
    <SCRIPT SRC=isomorphic/system/modules/ISC_Forms.js></SCRIPT>
    <SCRIPT SRC=isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
    <SCRIPT SRC=isomorphic/system/modules/ISC_Calendar.js></SCRIPT>
  <SCRIPT SRC=isomorphic/skins/standard/load_skin.js></SCRIPT>
</HEAD>


<BODY BGCOLOR='silver'>

<SCRIPT>
countryData = [

{
    continent:"North America",
    countryName:"United States",
    countryCode:"US",
    area:9631420,
    population:298444215,
    gdp:12360.0,
    independence:new Date(1776,6,4),
    government:"federal republic",
    government_desc:2,
    capital:"Washington, DC",
    member_g8:true,
    article:"http://en.wikipedia.org/wiki/United_states"
},
{
    continent:"Asia",
    countryName:"China",
    countryCode:"CH",
    area:9596960,
    population:1313973713,
    gdp:8859.0,
    government:"Communist state",
    government_desc:0,
    capital:"Beijing",
    member_g8:false,
    article:"http://en.wikipedia.org/wiki/China"
},
{
    continent:"Asia",
    countryName:"Japan",
    countryCode:"JA",
    area:377835,
    population:127463611,
    gdp:4018.0,
    government:"constitutional monarchy with parliamentary government",
    government_desc:1,
    capital:"Tokyo",
    member_g8:true,
    article:"http://en.wikipedia.org/wiki/Japan"
},
{
    continent:"Asia",
    countryName:"India",
    countryCode:"IN",
    area:3287590,
    population:1095351995,
    gdp:3611.0,
    independence:new Date(1947,7,15),
    government:"federal republic",
    government_desc:2,
    capital:"New Delhi",
    member_g8:false,
    article:"http://en.wikipedia.org/wiki/India"
},
{
    continent:"Europe",
    countryName:"Germany",
    countryCode:"GM",
    area:357021,
    population:82422299,
    gdp:2504.0,
    independence:new Date(1871,0,18),
    government:"federal republic",
    government_desc:2,
    capital:"Berlin",
    member_g8:true,
    article:"http://en.wikipedia.org/wiki/Germany"
},
{
    continent:"Europe",
    countryName:"United Kingdom",
    countryCode:"UK",
    area:244820,
    population:60609153,
    gdp:1830.0,
    independence:new Date(1801,0,1), 
    government:"constitutional monarchy",
    government_desc:1,
    capital:"London",
    member_g8:true,
    article:"http://en.wikipedia.org/wiki/United_kingdom"
},
{
    continent:"Europe",
    countryName:"France",
    countryCode:"FR",
    area:547030,
    population:60876136,
    gdp:1816.0,
    government:"republic",
    government_desc:5,
    capital:"Paris",
    member_g8:true,
    article:"http://en.wikipedia.org/wiki/France"
},
{
    continent:"Europe",
    countryName:"Italy",
    countryCode:"IT",
    area:301230,
    population:58133509,
    gdp:1698.0,
    independence:new Date(1861,2,17),
    government:"republic",
    government_desc:5,
    capital:"Rome",
    member_g8:true,
    article:"http://en.wikipedia.org/wiki/Italy"
},
{
    continent:"Asia",
    countryName:"Russia",
    countryCode:"RS",
    area:17075200,
    population:142893540,
    gdp:1589.0,
    independence:new Date(1991,7,24),
    government:"federation",
    government_desc:3,
    capital:"Moscow",
    member_g8:true,
    article:"http://en.wikipedia.org/wiki/Russia"
},
{
    continent:"South America",
    countryName:"Brazil",
    countryCode:"BR",
    area:8511965,
    population:188078227,
    gdp:1556.0,
    independence:new Date(1822,8,7),
    government:"federative republic",
    government_desc:3,
    capital:"Brasilia",
    member_g8:false,
    article:"http://en.wikipedia.org/wiki/Brazil"
},
{
    continent:"North America",
    countryName:"Canada",
    countryCode:"CA",
    area:9984670,
    population:33098932,
    gdp:1114.0,
    independence:new Date(1867,6,1),
    government:"constitutional monarchy with parliamentary democracy and federation",
    government_desc:1,
    capital:"Ottawa",
    member_g8:true,
    article:"http://en.wikipedia.org/wiki/Canada"
},
{
    continent:"North America",
    countryName:"Mexico",
    countryCode:"MX",
    area:1972550,
    population:107449525,
    gdp:1067.0,
    independence:new Date(1810,8,16),
    government:"federal republic",
    government_desc:2,
    capital:"Mexico (Distrito Federal)",
    member_g8:false,
    article:"http://en.wikipedia.org/wiki/Mexico"
},
{
    continent:"Europe",
    countryName:"Spain",
    countryCode:"SP",
    area:504782,
    population:40397842,
    gdp:1029.0,
    independence:new Date(1492,0,1),
    government:"parliamentary monarchy",
    government_desc:4,
    capital:"Madrid",
    member_g8:false,
    article:"http://en.wikipedia.org/wiki/Spain"
},
{
    continent:"Asia",
    countryName:"South Korea",
    countryCode:"KS",
    area:98480,
    population:48846823,
    gdp:965.3,
    independence:new Date(1945,7,15),
    government:"republic",
    government_desc:5,
    capital:"Seoul",
    member_g8:false,
    article:"http://en.wikipedia.org/wiki/South_korea"
},
{
    continent:"Asia",
    countryName:"Indonesia",
    countryCode:"ID",
    area:1919440,
    population:245452739,
    gdp:865.6,
    independence:new Date(1945,7,17),
    government:"republic",
    government_desc:5,
    capital:"Jakarta",
    member_g8:false,
    article:"http://en.wikipedia.org/wiki/Indonesia"
}

]
isc.DataSource.create({
    ID: "countryDS",
    fields:[
        {name:"countryCode", title:"Code"},
        {name:"countryName", title:"Country"},
        {name:"capital", title:"Capital"}
    ],
    clientOnly: true,
    testData: countryData
})
isc.ListGrid.create({
    ID: "countryList",
    width:500, height:224, alternateRecordStyles:true,
    wrapCells:true, cellHeight:32, // taller rows to fit 'government' values
    data: countryData,
    fields:[
        {name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"},
        {name:"countryName", title:"Country", width:120},
        {name:"government", title:"Government", showHover:true,
            hoverHTML:"return government_descriptions[record.government_desc]"
        }
    ],
    hoverWidth:300
})

isc.IButton.create({
    top:250,
    width:250,
    title:"Show Hover on every cell",
    actionType:"radio",
    radioGroup:"canHover",
    // When canHover is true on a ListGrid, cells will show hover text unless field.showHover is false
    click:"countryList.canHover = true"
})

isc.IButton.create({
    top:300,
    width:250,
    title:"Show Hover on <i>Government</i> cells only",
    actionType:"radio",
    radioGroup:"canHover",
    selected:true,
    // When canHover is unset on a ListGrid, cells will show hover text if field.showHover is true
    click:"countryList.canHover = null"
})

isc.IButton.create({
    top:350,
    width:250,
    title:"Suppress all cell hovers",
    actionType:"radio",
    radioGroup:"canHover",
    // When canHover is false on a ListGrid, cells will not show any hover text
    click:"countryList.canHover = false"
})


government_descriptions = [
    "<b>Communism</b> - a system of government in which the state plans and controls the economy and a single - often authoritarian - party holds power; state controls are imposed with the elimination of private ownership of property or capital while claiming to make progress toward a higher social order in which all goods are equally shared by the people (i.e., a classless society).",
    "<b>Constitutional monarchy</b> - a system of government in which a monarch is guided by a constitution whereby his/her rights, duties, and responsibilities are spelled out in written law or by custom.",
    "<b>Federal republic</b> - a state in which the powers of the central government are restricted and in which the component parts (states, colonies, or provinces) retain a degree of self-government; ultimate sovereign power rests with the voters who chose their governmental representatives.",
    "<b>Federal (Federative)</b> - a form of government in which sovereign power is formally divided - usually by means of a constitution - between a central authority and a number of constituent regions (states, colonies, or provinces) so that each region retains some management of its internal affairs; differs from a confederacy in that the central government exerts influence directly upon both individuals as well as upon the regional units.",
    "<b>Parliamentary monarchy</b> - a state headed by a monarch who is not actively involved in policy formation or implementation (i.e., the exercise of sovereign powers by a monarch in a ceremonial capacity); true governmental leadership is carried out by a cabinet and its head - a prime minister, premier, or chancellor - who are drawn from a legislature (parliament).",
    "<b>Republic</b> - a representative democracy in which the people's elected deputies (representatives), not the people themselves, vote on legislation."
]




</SCRIPT>


</BODY>
</HTML>

   
  








Related examples in the same category

1.wrapCells: true, fixedRecordHeights: false
2.Autofil row count
3.Boolean value cell renderer and editor
4.ListGrid with calculated value
5.Image cell renderer
6.Linkable image in a ListGrid
7.Hyper link in a ListGrid
8.ListGrid cell styling
9.Cell value format
10.Set empty cell value
11.Dynamic grouping
12.Custom grouping
13.Turn rollover effect off/on
14.Wrap cell value
15.Checkbox column
16.Table cell renderer: short date format
17.Localized date format
18.List grid with Checkbox cell renderer
19.Use expandable panel to edit table data