Welcome Guest, Not a member yet? Register   Sign In
Ignited DataTables

[eluser]ZaLiTHkA[/eluser]
[quote author="virtualgadjo" date="1343909519"]first, as long as you have
"iDisplayLength": 10,
in your js, the table will only display... 10 éléments Smile[/quote]
True, but all rows are included in the table, only 10 are shown per page. The search still searches the entire table, regardless of whether a row is on the currently displayed page or not.

[quote author="virtualgadjo" date="1343909519"]what i mean about the ajax thing is that, the serverside processing using datatables library is interesting only if you don't want to display all the data as it makes lighter requests
when you want to get all the data at first you don't need ajax nor datatables serverside library, just get all your data with a request in a ci model, put it in the view and then, as you want to take advantage of datatables functionnalities you can just use it without the server sideprocess, in its native progressive enhancement way in fact

have swing[/quote]
I've got a function set up to watch for AJAX calls, and display a global "Working.." message while waiting for a response. That was the main reason for using AJAX for the initial data load, however this same table will have it's contents replaced dynamically through AJAX calls without reloading the entire page.

So, thanks for the suggestions, but to be honest the way it's set up at the moment makes a bit more sense to me. Smile

[eluser]virtualgadjo[/eluser]
hi,

reading what you're saying i think i didn't understand your first post...
is the problem being the search request not sending the whole stuff and not when you first instaciate the table ?

something else, i think you should not change generate function but get_paging Smile

and if my second understanding is the correct one my very first modification of get_paging should be enough for it to work
actually, as i said, if no ilength is posted, datatables is set to use -1 by default, that to say, return everything

have swing

[eluser]Dermis[/eluser]
hi,

it has been a long time since i'm not update my CI, datatables and ignited data tables.

since i've updated to datatables 1.9.3 with latest ignited-datatables from github, my table did not shows any data.

my firebug console shows error :

Code:
TypeError: aData is undefined
for ( var i=0, iLen=aData.length ; i<iLen ; i++ )

and my json returned

Code:
{"sEcho":1,"iTotalRecords":68,"iTotalDisplayRecords":0,"aaData":[],"sColumns":"uid"}


im not sure what caused this error.

[eluser]José Neto[/eluser]
I'm having the same problem. Any answer?
[quote author="Dermis" date="1344747054"]hi,

it has been a long time since i'm not update my CI, datatables and ignited data tables.

since i've updated to datatables 1.9.3 with latest ignited-datatables from github, my table did not shows any data.

my firebug console shows error :

Code:
TypeError: aData is undefined
for ( var i=0, iLen=aData.length ; i<iLen ; i++ )

and my json returned

Code:
{"sEcho":1,"iTotalRecords":68,"iTotalDisplayRecords":0,"aaData":[],"sColumns":"uid"}


im not sure what caused this error.
[/quote]

[eluser]Unknown[/eluser]
I need help, I'm using codeigniter 2.1 however use 3 types of database (mysql, mssql and oracle), must use the data tables in the three databases.

Could someone help me.

thank you

[eluser]ZaLiTHkA[/eluser]
[quote author="Dermis" date="1344747054"]hi,

it has been a long time since i'm not update my CI, datatables and ignited data tables.

since i've updated to datatables 1.9.3 with latest ignited-datatables from github, my table did not shows any data.

my firebug console shows error :

Code:
TypeError: aData is undefined
for ( var i=0, iLen=aData.length ; i<iLen ; i++ )

and my json returned

Code:
{"sEcho":1,"iTotalRecords":68,"iTotalDisplayRecords":0,"aaData":[],"sColumns":"uid"}


im not sure what caused this error.
[/quote]

[quote author="José Neto" date="1345677386"]I'm having the same problem. Any answer?[/quote]

I suspect this is a simple issue, in the JS where you initialize your datatable, try changing this line...
Code:
for ( var i=0, iLen=aData.length ; i<iLen ; i++ )
...to this:
Code:
for ( var i=0, iLen=aaData.length ; i<iLen ; i++ )

Your for loop is checking for the length of an array that doesn't exist (notice the "aData.length" and "aaData.length"). Hope that helps. Smile

[eluser]livewirerules[/eluser]
my tables are not being populated, instead it throwing me this error


Quote:DataTables warning (table id = 'student_table'): Requested unknown parameter '1' from the data source for row 0

Below is my js code
Code:
script type="text/javascript" charset="utf-8">
$(document).ready(function() {
    $('#student_table').dataTable( {
        "bProcessing": true,
        "bServerSide": true,
        "sServerMethod": "POST",
        "sAjaxSource": "&lt;?php echo base_url()?&gt;index.php/data/all"
    } );            
} );
[removed]

when i directly access index.php/data/all i get the below result
Code:
{"sEcho":0,"iTotalRecords":3,"iTotalDisplayRecords":3,"aaData":[["85","t1","1D"],["74","test475","4A"],["777","maiz","5"]],"sColumns":"id,name,class"}



below is my html table
Code:
<table class="datatable tables" id="student_table">
                            <thead>
                                <tr>
                                        <th>ID</th>
                                        <th>Name</th>
                                        <th>Class</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="dataTables_empty">Loading data from server</td>
                                                                    </tr>
                            </tbody>
                        </table>

and below is my model
Code:
$this->load->library('datatables');

    $this->datatables->select('admission,name,class');
    $this->datatables->from('students');
    echo $this->datatables->generate();

for almost 4 days im trying to solve this problem.. can some one please help me.. any help will be appreciated

[eluser]Unknown[/eluser]
livewirerules the fixed is in page 36.

[eluser]Unknown[/eluser]
I'm having problem with IgnitedDatatables-native-php-version.
I'm using MySQLi and getting this error:


<b>Warning</b>: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in <b>xxx/scripts/datatables/dataTables.ignition.php</b> on line <b>64</b><br />

Code responsiblke for that error:

Code:
protected function input($field, $escape = TRUE)
    {
      if(isset($_POST['sEcho']) && isset($_POST[$field]))
        return ($escape == TRUE)? mysql_real_escape_string($_POST[$field]) : $_POST[$field];
      elseif(isset($_GET['sEcho']) && isset($_GET[$field]))
        return ($escape == TRUE)? mysql_real_escape_string($_GET[$field]) : $_GET[$field];
      else
        return FALSE;
    }

How to change this code to be compatible with mysqli ?

[eluser]ηυмвєяσηє[/eluser]
hi solver,

i have just updated the native version of the library for that.. check it.



Regards..
Yusuf




Theme © iAndrew 2016 - Forum software by © MyBB