jQWidgets Forums

jQuery UI Widgets Forums React cellsrenderer with onClick

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Hristo 5 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • cellsrenderer with onClick #108064

    pfullen
    Participant

    Hi I am using jQGrid with React.
    I am able to customize the cell with cellrenderer
    However I am having a hard time figuring out how to implement an OnClick

    let columns =
    [
    { text: ‘Company Name’, datafield: ‘compName’, cellsalign: ‘center’,width: ‘auto’, align: ‘center’, cellsrenderer: function (ndex, datafield, value, defaultvalue, column, rowdata) {
    return <a href="#" title="${'View '+rowdata.compName+' artifacts'}"><div style="text-align:center;" class="align-self-center align-middle"><button type="button" style="padding-top:0.1rem;" class="btn btn-link align-self-center"<strong> onClick={onloadCompData('${ndex}')}</strong>>${rowdata.compName}</button></div></a>;
    },… etc etc

    I am able to change the onloadComp to a console.log but when i try to call a function I get an error.
    Is there an example where this is implemented?\
    I really appreciate any help you can provide

    cellsrenderer with onClick #108065

    pfullen
    Participant

    I was able to get this to work with using the buttonclick: …
    Is it possible to have this be a span or something else? For example span: (row) => { this.onCellClick(row) }
    My concern is having to then style the button in the grid.

    Thanks a bunch for your assistance

    Pete

    cellsrenderer with onClick #108071

    Hristo
    Participant

    Hello Pete,

    You could set the desired style settings in the cellsrenderer callback or the cellclassname callback, too.
    I hope this will help.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

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

You must be logged in to reply to this topic.