question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sometimes images columns get collapsed

See original GitHub issue

Hi there,

I’m using tabulator to display small images - something like 128x128. Occasionally I get something like this: image

Sometimes it happens during the sort, sometimes it is like this when the data is loaded. Sometimes it is fine.

The way I define this columns is like this:

                                {
                                    title: "source_image",
                                    field: "source_image",
                                    formatter: 'image',
                                    width: 128,
                                    align: "center",
                                }

Then I take img source as base64 png stream.

I also use layout: "fitDataFill"

Am I using this wrong?

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
olifolkerdcommented, Dec 28, 2017

Hey All,

This is happening because the image is loading after the table has been drawn so the row height has been fixed while the image is not at its full height,

A more advanced version of the image formatter will be coming in the next release.

in the mean time i would suggest creating a custom image formatter and either setting a height on your image elements or calling the normalizeHeight function on the row component when the image has loaded:

var imageFormatter = function(cell, formatterParams){
    var image = $("<img src='" + cell.getValue() + "'></img>");
    
    image.on("load", function(e){
        cell.getRow().normalizeHeight();
    });

    return image;
}

Cheers

Oli

0reactions
olifolkerdcommented, Feb 12, 2018

Tabulator version 3.4 has now been officially release!

You can find details of the new release in the News Section

Full documentation of all the new features can be found Here

Cheers

Oli 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Images Pile Up when Filtering - Excel Ribbon Tips
In other words, the result for the photos column is not filtered; the unwanted photos do not collapse with the row when it...
Read more >
Responsive Image not Collapsing - html - Stack Overflow
When I drag in I want the images to resize, which they do (eventually I'm going to add some code that puts them...
Read more >
How do I collapse a picture when I collapse a group of rows
I collapse the groups to leave a simple descriptor, but the pictures do not collapse (hide ?) with the rows. This thread is...
Read more >
Collapsible columns in Table view - Coda Maker Community
Sometimes tables can have a lot of attribute data columns. In my document scheme, I separate the tables from content pages, where I...
Read more >
Preventing Content Reflow From Lazy-Loaded Images
That said, it does indeed introduce a noticeable problem: images not containing the src attribute (including when it's empty or invalid) have no ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found