Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81728

Column Render not rendering properly.

$
0
0

Hi All,

Request your help, when I manually execute the php program the output is as below(PHP Output), the "Output" column is an array , so in my ajax i have the below lines(AJAX Query), it is rendering the first array (0) properly , but the second array(1) the value is display as single line "FAILED FAILED FAILED" rather than multiple lines as 

FAILED
FAILED
FAILED

PHP Output

    [0] => Array
        (
            [Server] => T1
            [Task] => T01
            [Output] => Array
                (
                    [0] => FAILED
                )

        )

    [1] => Array
        (
            [Server] => T2
            [Task] => T01
            [Output] => Array
                (
                    [0] => FAILED 
                    [1] => FAILED
                    [2] => FAILED
                )

        )

AJAX Query

            columns: [
                        { data: "Server" },
                        { data: "Task", className: "dt-body-left h8" },
                        { data: "Output",
                          render: function (data, type, row) {
                                           var odata = '';
                                           for (i=0; i<data.length; i++) {
                                                odata += '<p class="dt-body-left h8 text-danger" colspan="2">' + data[i] + '</p>'
                                           }
                                           return odata;
                                  }
                        }
            ]

Viewing all articles
Browse latest Browse all 81728

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>