Problem using code from Examples

Problem using code from Examples

Pliachas PaschalisPliachas Paschalis Posts: 69Questions: 13Answers: 1

i use the demo examples code and specifically this one:
i use this part of code from


var table = $('#dataTables-example').DataTable( { dom: "Bfrtip", ajax: "../php/agent.php", columns: [ { data: "First_name" }, { data: "Last_Name" }, { data: "Phone" }, { data: "Website" }, { data: "Photo"//, //render: function ( file_id ) { //return file_id ? //'<img src="'+table.file( 'image', file_id ).web_path+'"/>' : //null; //} ,render: function ( file_id ) { return file_id ? '<img src="'+table.file( 'files', file_id ).web_path+'"/>' : null; }, defaultContent: "No image", title: "Image" } ], select: true, buttons: [ { extend: "create", editor: editor }, { extend: "edit", editor: editor }, { extend: "remove", editor: editor } ] } ); });

if i remark the following part of code the rows on the table shows but i can not see the refered image

render: function ( file_id ) {
                    return file_id ?
                        '<img src="'+table.file( 'files', file_id ).web_path+'"/>' :
                        null;

If i use it normally (non remarkable code) i get this on debugger: TypeError: f[(q7G + l1Q.Q8)][a] is undefined
Any idea?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Is this the same as your question in your other thread?

    Allan

  • Pliachas PaschalisPliachas Paschalis Posts: 69Questions: 13Answers: 1

    Similar. Because i was trying to find a solution and as i was changing the code i was getting to several results. So the last one was that question.

This discussion has been closed.