Image problem with sorting in a datatable

UI Components for React
Post Reply
Mic
Posts: 18
Joined: 27 Sep 2010, 15:59

27 Jan 2021, 11:38

Hi...

I've found a problem with the Image object. I'm using a graphic in a aortable datatable with body={btImage} for a column. If I use <Image> instead of <img>, the images will not be sorted. Here the btImage function for the test case - the first image will be changed but not the second one:

Code: Select all

function btImage(data, props) {
    return (
        <>
            <img className="p-column-image" src={"/images/" + data[props.field]} width={40} height={45} />
            <Image className="p-column-image" src={"/images/" + data[props.field]} width={40} height={45} />
        </>
    );
}
Best regards,
Mic

mert.sincan
Posts: 4637
Joined: 29 Jun 2013, 12:38

02 Feb 2021, 16:36

Hi,

What is the <Image> tag??? I think you can use sortFunction property for such issues;
https://primefaces.org/primereact/showcase/#/datatable

Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests