ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Ignited DataTables

July 15, 2010 2:51am

Subscribe [119]
  • #271 / Nov 16, 2011 2:52am

    cryogenix

    90 posts

    if you don’t like echoing stuff in your controller, then simply load an ajax view in that controller… and still call that controller in your sAjaxSource…

    you might want to take a look at my post: http://ellislab.com/forums/viewreply/940908/ and also my explanation: http://ellislab.com/forums/viewreply/942604/

  • #272 / Nov 16, 2011 2:56am

    zadro

    5 posts

    what is this ajax view? That’s the part that I don’t understand after reading this entire thread for a LONG time…thanks for replying. Please explain the ajax view (show code).

    In other words, what is inside ajax.php or where is this file??

  • #273 / Nov 16, 2011 3:13am

    cryogenix

    90 posts

    its simply a file to load all the generated json code:

    application/views/ajax.php:

    <?php echo $result; ?>
  • #274 / Nov 16, 2011 3:27am

    zadro

    5 posts

    Oops..duh. I guess my problem is really that I have to load a view within a view since I’m using jquery tabs. Not a topic for this thread. Thanks again! Very nice work with this Library.

  • #275 / Nov 17, 2011 6:10am

    LoganPHP

    15 posts

    How to i use

    find_in_set('4',user)

    in where condition?

    I tried following one but it shows empty row

    $this->datatables
     ->select("id,name,filename",FALSE)
     ->from("tb_upload")
     ->where("find_in_set('4',user)");

    Please help me

    thanks in advance,Logan

  • #276 / Nov 17, 2011 8:39pm

    cryogenix

    90 posts

    try:

    $this->datatables->where("find_in_set('4', user)", NULL, FALSE);

    this is based on codeigniter’s user guide database->active record

    on the definition of $this->db->where(), the 4th part talks about passing custom strings.

    http://ellislab.com/codeigniter/user-guide/database/active_record.html

  • #277 / Nov 18, 2011 3:56pm

    jtrainaldi

    24 posts

    Weird Quirk disregard.  I went back and started reading some old posts in this thread.

  • #278 / Nov 19, 2011 12:12pm

    vazmer

    2 posts

    I have a problem with OR within WHERE clause. It works when the table is initialized (the results are correct), but when trying to filter table data nothing happens.

    For example, this won’t work:

    ->where("(departure LIKE '%SOME_VALUE%') OR (arrival LIKE '%SOME_VALUE%') ");

    This will work, but I need OR, not AND.

    ->where("(departure LIKE '%SOME_VALUE%') AND (arrival LIKE '%SOME_VALUE%') ");
  • #279 / Nov 19, 2011 12:47pm

    ηυмвєяσηє

    109 posts

    I have a problem with OR within WHERE clause. It works when the table is initialized (the results are correct), but when trying to filter table data nothing happens.

    For example, this won’t work:

    ->where("(departure LIKE '%SOME_VALUE%') OR (arrival LIKE '%SOME_VALUE%') ");

    This will work, but I need OR, not AND.

    ->where("(departure LIKE '%SOME_VALUE%') AND (arrival LIKE '%SOME_VALUE%') ");


    Try

    ->where("((departure LIKE '%SOME_VALUE%') OR (arrival LIKE '%SOME_VALUE%') )");

     

  • #280 / Nov 19, 2011 12:50pm

    vazmer

    2 posts

    It works! Thank you very much! 😊

  • #281 / Nov 22, 2011 3:53pm

    jtrainaldi

    24 posts

    I am manually changing the “iDisplayLength” to a value greater than 10 but the table will only show 10 records at a time.  Also the datatable generate function only pulls 10 records from the database.  The only way to retrieve more than 10 records from the database I had to change the iLenght value in the get_paging() function.

    Is there a way to change that value to get this to work.

    $('#wtable').dataTable({
                "bPaginate": true,
                "bFilter": true,
                "bSort": true,
                "bAutoWidth": false,
                "sDom": '<"top"f>t<"bottom"lip>',  
                "sAjaxSource": "<?php echo site_url('ajax/controller/get_table_data'); ?>",
       "iDisplayLength ": 50,
                "aaSorting": [[ 6, "desc" ]],
       'aoColumns' : [
        { 'sName': 'entry.publish_status', 'bSortable': false },
        { 'sName': 'entry.entry_id'},
        { 'sName': 'employee_name'},
        { 'sName': 'employee.first_name', 'bVisible': false },
        { 'sName': 'building.building_name'},
        { 'sName': 'entry.observed_by' },
        { 'sName': 'entry.date_submitted' },
        { 'sName': 'functions', 'bSortable': false },
       ],
            });

    Thank you in advance.

  • #282 / Nov 23, 2011 7:34am

    Manish bhai

    2 posts

    nice post

    thanks for sharing

    Handicrafts products in Mumbai, India

  • #283 / Nov 23, 2011 7:46am

    Manish bhai

    2 posts

    nice information

    thanks for sharing

    Handicrafts Products in Mumbai,India

  • #284 / Nov 25, 2011 11:55pm

    zadro

    5 posts

    Trying to execute a simple callback in a helper file and it doesn’t do anything.

    //leaddate = yyyy-mm-dd hh:mm:ss
    $this->datatables->edit_column('leaddate','$1',format_date('leaddate'));

    in helper file

    if(!function_exists('format_date')){
    
     function format_date($tdate)
     {
        $part=explode(" ",$tdate);
        return $part[0];
      } 
    }

    no errors, just returns the date as if it didn’t use the function…very strange?? would actually like it to return am/pm format, but just trying to get this to work first. thanks.

  • #285 / Nov 26, 2011 2:15am

    ηυмвєяσηє

    109 posts

    $this->datatables->edit_column('leaddate','$1',"format_date('leaddate')"); 
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases