Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    display multiple icon in listgrid taken from datasource

    hi,
    i got the problem that when i want to display data from datasource by using an icon in listgrid,

    example data in datasource -->

    high : E,S (stand for----> Email, SMS)
    normal : E
    low : S

    icon display in listgrid represent E (display icon email)
    icon display in listgrid represent S (display icon SMS)
    the icon display in listgrid represent E,S (only show one icon that cannot display)

    how to separate E and S if this (E,S) problem occur??
    can you show me the way to code it?
    tq

    #2
    If you're trying to display two icons, override listGridField.formatCellValue() and return something like isc.Canvas.imgHTML(...) + "," + isc.Canvas.imgHTML(...).

    Comment


      #3
      tq..it works!

      Comment


        #4
        By applying the suggested solution, how can I display different message when mouse over different icon in the same cell.

        Comment


          #5
          You could pass "alt='some message'" as the "extraStuff" parameter to imgHTML()

          Comment


            #6
            The alt works only in IE but not in firefox, any other ways to show the message?

            Comment


              #7
              Make sure you've got your quotes correct (use single inside double). If it's still not working, please show your attempt.

              Comment


                #8
                Yes, I did used single quotes inside double quotes, below is my attemp

                Code:
                <HTML>
                <HEAD>
                	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
                		<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/skins/TreeFrog/load_skin.js></SCRIPT>
                </HEAD>
                
                <BODY>
                <SCRIPT><!--
                
                var 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,
                	},
                	{
                	    continent:"Asia",
                	    countryName:"China",
                	    countryCode:"CH",
                	    area:9596960,
                	    population:1313973713,
                	    gdp:8859.0,
                	    government:"Communist state",
                	    government_desc:0,
                	    capital:"Beijing",
                	    member_g8:false,
                	},
                	{
                	    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,
                	},
                ]
                
                
                
                isc.ListGrid.create({
                    ID: "countryList",
                    width:500, height:224, alternateRecordStyles:true,
                    data: countryData,
                    fields:[
                        {name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"},
                        {name:"countryName", title:"Country"},
                        {name:"capital", title:"Capital", showIf:"false"},
                        {name:"continent", title:"Continent", formatCellValue:"displayContinent()"}
                    ],
                    canReorderFields: true
                })
                
                function displayContinent(){
                	return "<table><tr><td>"+isc.Canvas.imgHTML({src:"/images/continent.png", extraStuff: "alt='Continent Extra Info'"})+"</td></tr></table>";
                }
                
                --> </SCRIPT>
                </BODY>
                </HTML>

                Please also note that I've done a simple test without smartclient component (see code below), the mouse over text is working in IE but not in Firefox.

                Comment


                  #9
                  Opps, sorry, forgot to include the simple test code that is without SmartClient component. Please see below

                  Code:
                  <html>
                  <body>
                  	<img src='/iSCADA/config/images/email_recur.png'  alt='email'/>
                  </body>
                  </html>

                  Comment

                  Working...
                  X