Problem with Request Server Side

Problem with Request Server Side

mypumasmypumas Posts: 1Questions: 0Answers: 0
edited February 2015 in Free community support

Hello all and sorry for advance for my english.

I will to try implement a datagrid with server-side data coming.
And to begin, i will try with an json file (test.txt)

See below the contain :

[
  {
    "PACKAGE_NAME":"ACB-20150130-A350-V5-WP_Key_ACB000",
    "DESCRIPTION":"V53314575",
    "ISSUE":"A00"
  },
  {
    "PACKAGE_NAME":"ACB-20150130-A350-V5-WP_Key_ACB001",
    "DESCRIPTION":"V53314575",
    "ISSUE":"A00"
  }
]

And below the client script :

$(document).ready(function () {
                      \'use strict\';
                                                                        
                         var oTable2 = $(\'#entrys_table\').DataTable({
                            "responsive": true,
                            "processing": true,
                             "ajax": "http://serveurside/test.txt",
                             "columns": [{
                                "data": "PACKAGE_NAME"
                               }, {
                                "data": "DESCRIPTION"
                               }, {
                                "data": "ISSUE"
                            }]
                        });
                        
                        //----------------------------------------------
                        //notice the new yadcf API for init the filters:
                        //----------------------------------------------
                        
                        yadcf.init(oTable2, [{
                            column_number: 0
                        }, {
                            column_number: 1
                        }, {
                            column_number: 2
                        }]);
                });

And the HTML :

div id="table_2">
table cellpadding="0" cellspacing="0" border="0" class="display" id="entrys_table" width="100%">
thead>
tr>
    th>PACKAGE</th>
    th>DESCRIPTION</th>
                th>ISSUE</th>
/tr>
/thead>
/table>
/div>

Result :

I have a table but without the data......

Couls you help me please ??

Regards,

Replies

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    For one thing, your HTML is a mess. Several tags are missing the opening < symbol.

  • allanallan Posts: 61,805Questions: 1Answers: 10,119 Site admin

    Fairly sure that the HTML is "broken" to make it look readable in forum. Without code highlighting (@mypumas the instructions for which are just below the text input box) the forum strips HTML, so I guess this was the attempted workaround :-)

    @mypumas - Use ajax.dataSrc and set it to be an empty string if you are just loading an array of data.

    Allan

This discussion has been closed.