Find image change source

Find image change source

WotikarWotikar Posts: 1Questions: 1Answers: 0
edited February 2019 in Free community support

Probably asked multiple times but i can't figure it out.

I wan't to find a image in a cell and change its source when there is clicked on a button outside the datatable. The row with the cell containing the image varies.

var table = $('#TblPos').DataTable();
            var rows = table.rows();

            rows.each(function (value, index) {
                var cell = rows.cells(index);
                var img = $(cell).find('#Img+cll.data());
            });

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @Wotikar ,

    You can change (and retrieve) the data for a cell with cell().data() - you could do this in the click event handler for the button.

    Cheers,

    Colin

This discussion has been closed.