Results 1 to 6 of 6

Thread: DrawComponent in grid

  1. #1
    Ext GWT Premium Member
    Join Date
    Dec 2010
    Posts
    12
    Vote Rating
    0
      0  

    Default DrawComponent in grid

    I want to draw an image with DrawComponent and add that to a grid. Is it possible? I can't find something like a DrawComponentCell in order to do the rendering of the drawComponent.

  2. #2
    Sencha User BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Answers
    3
    Vote Rating
    3
      0  

    Default

    No there is no draw cell and it is probably to complex a component to be made a cell. What are you trying to do exactly?

  3. #3
    Ext GWT Premium Member
    Join Date
    Dec 2010
    Posts
    12
    Vote Rating
    0
      0  

    Default

    I need to display an icon in a grid. The icon is not complex but the color must be unique for each row in the grid. Currently I create the icon on server side based on the color parameters I pass in via a URL and then I render the icon in the grid via an ImageCell. This is a bit slow. I thought that drawing the icon on the client side might be faster.

  4. #4
    Sencha User BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Answers
    3
    Vote Rating
    3
      0  

    Default

    Yeah even if there was something like draw component cell having a draw component surface for each icon would become very taxing. Unfortunately I don't think the draw package can help you in this situation.

  5. #5
    Sencha User PhiLho's Avatar
    Join Date
    Nov 2011
    Location
    Near Paris, France
    Posts
    140
    Answers
    2
    Vote Rating
    1
      0  

    Default

    A classical trick in Web design is to transmit only one image with several widgets (the trick is used by Sencha in their menu icons, among others).
    Perhaps you can make the server to draw all the icons you need (for a given view) in a single image (in a row or in a column) and use the image as background of a span, with CSS selecting the position and size of the background with regard to the span area. Thus, only the selected image is displayed. Never tried this in GWT, though... Perhaps it offers facilities for this functionality (I guess so).

  6. #6
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Answers
    109
    Vote Rating
    93
      0  

    Default

    Another idea, if just the color needs to be changed of part of the icon, is to use an image with transparency set for part of it, and always draw the same image, but with a different background color each time.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •