jQWidgets Forums

jQuery UI Widgets Forums React Returning JSX to "cellsrenderer"

This topic contains 1 reply, has 2 voices, and was last updated by  Yavor Dashev 3 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Returning JSX to "cellsrenderer" #120841

    jscoulter
    Participant

    HI There.
    I am working on implementing a grid in our new React project.
    When the grid is populating a specific column and it is being rendered we are using “cellsrenderer” to call a TypeScript function and then based on the value of the cell in the column we change the returned HTML to show one thing or another.
    That works fine.
    However, I have into an issue where I want to render a button that will call another function when clicked, like this :

    return(
    <div><button onClick={this.displayPopover}>{value}</button></div>
    )
    Except…..this throws the following error:

    TypeError: u.indexOf is not a function
    _rendercell
    D:/CurrentDevelopment/ColFaceReactUI/trunk/node_modules/jqwidgets-scripts/jqwidgets/jqxgrid.js:9889

    There are a lot more data displayed with multiple errors for errors in different parts of jqxCore etc.
    So if I wrap the <div> line above in quotes, it works fine, on and deal with the “value” so its concatenated to the returned string, but then the onClick event doesnt fire. So I added the following to just under the “super(props)” because I saw something like this in another forum post:

    this.displayPopover = this.displayPopover.bind(this);

    Unfortunately this didnt work either.
    I am clearly doing something wrong but I am not sure what to do to resolve it. Can you please provide some assistance.

    Thanks, Jeremy

    Returning JSX to "cellsrenderer" #120845

    Yavor Dashev
    Participant

    Hi Jeremy,

    I would like to ask you to create a complete code example which reproduces the scenario/issue that you have in order to be able to give you a suitable solution for it.

    Also if you don’t use the latest version of jQWidgets I strongly recommend you to update to the latest one.

    Please, do not hesitate to contact us if you have any additional questions.

    Best Regards,
    Yavor Dashev
    jQWidgets team
    https://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.