Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery DataTable with Ignited-Datatables CodeIgniter
    primarykey
    data
    text
    <p><strong>Update:</strong></p> <blockquote> <p>I finally found the solution for this problem. If you face the same problem as mine, you can try visit this <a href="http://codeigniter.com/forums/viewthread/160896/P340/#1013662" rel="nofollow noreferrer">link </a></p> </blockquote> <p>I am having problem when want to integrate <a href="http://datatables.net" rel="nofollow noreferrer">Jquery DataTables</a> with <a href="https://github.com/IgnitedDatatables/Ignited-Datatables" rel="nofollow noreferrer">CodeIgniter Ignited-Datatables</a> library</p> <p>When I use the default DataTables <strong>sServerMethod</strong> property which is "GET", I got the json response with data from my php. However since CodeIgniter use post, I stuck at loading server data although the function return me correct json output.</p> <p><img src="https://i.stack.imgur.com/Q3WEH.png" alt="enter image description here"></p> <p>So I follow this <a href="http://gvlatko.com/2012/datables-stuck-on-server-side-processing-solution-for-codeigniter-with-ignitedtables/" rel="nofollow noreferrer">guide </a> to change the <strong>sServerMethod</strong> to "POST". Now I dont stuck at loading server data, but I dont get the data that I need.</p> <p>JSON response using <strong>sServerMethod</strong> GET (get correct json, but stuck at loading server data as in the image)</p> <pre><code>{ "sEcho": 0, "iTotalRecords": 10, "iTotalDisplayRecords": 10, "aaData": [ [ "Munauwar", "Syed", "Mr", "6012345678", "0000-00-00", "basikal" ], [ "Mak", "Je Wei", "Mr", "6012345678", "0000-00-00", "motor" ] ], "sColumns": "first_name,last_name,salutation,number,birthday,group_name"} </code></pre> <p>JSON response using <strong>sServerMethod</strong> POST</p> <pre><code>{ "sEcho": 1, "iTotalRecords": 10, "iTotalDisplayRecords": 0, "aaData": [], "sColumns": "first_name,last_name,salutation,number,birthday,group_name"} </code></pre> <p>This is my javascript code</p> <pre><code>$('#table1').dataTable({ "bProcessing": true, "bServerSide": true, "sPaginationType": "bootstrap", "sAjaxSource": config.base_url + "contact/popup_contact", "sServerMethod": "POST" }); </code></pre> <p>My function in contact controller</p> <pre><code>function popup_contact() { $this-&gt;datatables -&gt;select('first_name,last_name,salutation,number,birthday,group_name') -&gt;from('tb_contact') -&gt;join('tb_contact_group', 'tb_contact.contact_group_id = tb_contact_group.contact_group_id'); echo $this-&gt;datatables-&gt;generate(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload