mardi 3 janvier 2017

Datatables - On click from image

I have a datatable populated by 4 fields via a Laravel route. That is fine and works great.

Additionally I have added 2 columns with icons, again that is fine. One is to show a sliding panel of information and one will be a link to more details.

I show these by rendering column info.

I wish to have an onlick event for one which will use the data in column 0 which is a key field. I have tried:

{
  "targets": [4], 
  "render": function ( data, type, full, meta ) {
            {return '<div align="center"><a href="#"><img src="" id="trigger" onclick="ShowSlider(  + 0 +  )"></a></div>';}    
                                }
                    },

This is in the columnDefs, but clicking does not do anything - even if I put a simple alert.

Help, please!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire