Results 1 to 3 of 3

Thread: Thumbnail in modern grid cell (2nd try)

  1. #1
    Sencha User
    Join Date
    Apr 2017
    Posts
    11
    Answers
    1

    Default Answered: Thumbnail in modern grid cell (2nd try)

    Sorry for posting this twice - my previous post seems to be blank an unreadable.

    I'm trying to create an image metadata viewer where I'd like to view image metadata and the corresponding thumbnail image in a grid (ExtJS modern 6.6).

    I'm stuck at how to view the thumbnail. My aproach is to create a column renderer with an Ext.img object, however the cell shows [object,Object] instead of the image.

    Can anyone tell me how to get the renderer working or if there is another way to display the image in a cell.

    My fiddle showing my attempt: https://fiddle.sencha.com/#view/editor&fiddle/2jcn

    Mikael

  2. Here is a fiddle to accomplish what you are asking



    Notice how your code was change to simply return a HTML string rather than an image component. A cell definition was added because the default cell type is textcell; encodeHtml was set to false so it would handle the html properly.

    After several attempts I was not able to find a solution using your fiddle and creating and image object.

  3. #2
    Sencha MVP Team Member
    Join Date
    Sep 2016
    Location
    Kennewick, WA
    Posts
    150
    Answers
    15

    Default

    Here is a fiddle to accomplish what you are asking



    Notice how your code was change to simply return a HTML string rather than an image component. A cell definition was added because the default cell type is textcell; encodeHtml was set to false so it would handle the html properly.

    After several attempts I was not able to find a solution using your fiddle and creating and image object.

  4. #3
    Sencha User
    Join Date
    Apr 2017
    Posts
    11
    Answers
    1

    Default

    Tank you.

    Setting cell type and encodeHtml did the trick (and opens up for several alternative solutions).

    An alternative to my approach of using a renderer is to use a template: tpl: '<img src="{url}" />'

Similar Threads

  1. How to view a thumbnail in a grid cell
    By m.j in forum Ext JS 6.x Q&A
    Replies: 1
    Last Post: 23 Jan 2019, 3:20 AM
  2. Modern Grid cell tools - why weight is assigned?
    By LesJ in forum Ext JS 6.x Q&A
    Replies: 0
    Last Post: 27 Jun 2017, 6:46 AM
  3. Grid Cell Wrapping in Modern Toolkit
    By gsoc2014 in forum Ext JS 6.x Q&A
    Replies: 0
    Last Post: 29 Dec 2016, 11:23 AM
  4. [FIXED] cell color in gridsummaryrow in modern grid
    By kurtov in forum Ext JS 6.x Bugs
    Replies: 3
    Last Post: 10 Mar 2016, 12:09 AM
  5. sortable thumbnail grid
    By Chromatik in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 14 Sep 2010, 9:03 AM

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
  •