0

On my SharePoint list, I have a rich text with picture. When I retrieve it on my webPart, the picture doesn't get displayed. I obtained plain text but how can I display picture.

i already tried this but it doesn't work :-

private _onRenderCell(item: IExampleItem, index: number | undefined): JSX.Element {
    //pour pouvoir lire les balise html sur la multi-line text
    let dummyElement = document.createElement ("DIV"); 

    dummyElement .innerHTML = item.Reponse; 
    let reponse = dummyElement.innerText;
    const { collapsed } = this.state;
    return (

        <Accordion title={item.Question}
        defaultCollapsed={ collapsed} className={classNames.itemCell} key={index}>
        <div className={classNames.itemContent}>
          <div className={classNames.itemReponse}>{reponse}</div>
          <div className={classNames.itemIndex}>{`${item.Categorie.Title} :`+ ` ${item.Langue.Nom}`}</div>
        </div>
        </Accordion>
         );
  }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.