Announcement

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

    Canvas.setContents issue with IE

    SmartGWT 2.3 Pro (2010-08-03)
    IE 8.0.7600.16385
    Windows 7

    Hi All,

    When I pass an HTML string (fragment) containing a table definition to Canvas.setContents it is displayed as one would expect in both FF and Chrome, but in IE all style information included is ignored.

    In case anyone is wondering, I would much rather build up a series of HLayout/VLayout elements programmatically to create the table structure but although I got the layout logic to work fine (including with cells spanning multiple rows) I had troubles with getting the precise eventual column widths correct due to the nested layers, hence I had to resort to generating HTML to supply to a canvas.

    Has anybody had specific experience with style information being ignored by IE?

    I have a workaround and that is to specify all style information for the table element, and each <tr>, <th>, <td> element but this is quite ugly.

    I've attached a sample generated html file which when viewed in all three browsers looks fine, but when the same string is passed to the setContents method doesn't produce the expected results when the current browser is IE.
    Attached Files

    #2
    This is not a valid HTML fragment. You've got a <head> element (only appropriate in a complete HTML file) and a <tbody> element (which looks like it should just be removed).

    Also not clear why you wouldn't render this with a ListGrid - very simple to do.

    Comment


      #3
      Hi Isomorphic,

      Thanks for the info; I'll give it a try.

      Re. the use of ListGrid, I would be much happier to use this class. But I did ask a question

      Code:
      http://forums.smartclient.com/showthread.php?t=14863
      the other day about centering values vertically over a number of rows but didn't receive any reply, so was forced down the HTML generation route.

      Please tell me that there is some approach involving ListGrid which could be used to achieve the same idea - I'd be very happy to hear about this.

      For an idea of the kind of visual results I'm looking to achieve, have a look at this page (and in particular the production/sales table at the end)

      Code:
      http://www.htmlcodetutorial.com/tables/index_famsupp_30.html
      Last edited by somewhereinbelgium; 23 Jan 2011, 10:03.

      Comment


        #4
        Seems the question is really about row-spanning cells - for that, the CubeGrid component, available in SmartGWT as of 2.4 (with Power+Analytics license) has this capability.

        Comment


          #5
          Hi Isomorphic,

          Indeed the question is about row-spanning cells. Unfortunately I only have a Pro licence for the moment so it's not really an option but it's still good to know about it.

          Thanks

          Alastair

          Comment

          Working...
          X