DataTable 1.6.2 [add extra rows]

DataTable 1.6.2 [add extra rows]

pakypaky Posts: 106Questions: 0Answers: 0
edited April 2010 in General
Hi all ... how can add three extra rows always visible in my table (server.side.process type) ?

thanks

Replies

  • pakypaky Posts: 106Questions: 0Answers: 0
    edited April 2010
    sorry all I found solution ... in $sOutput loop !! The format a little difficult but I managed json ;)

    here code:
    (normal case)
    [code]
    $sOutput = '{';
    $sOutput .= '"sEcho": '.$_GET['sEcho'].', ';
    $sOutput .= '"iTotalRecords": '.$iTotal.', ';
    $sOutput .= '"iTotalDisplayRecords": '.$iFilteredTotal.', ';
    $sOutput .= '"aaData": [ ';
    while ( $aRow = mysql_fetch_array( $rResult ) )
    {
    $sOutput .= "[";
    $sOutput .= '"'.addslashes($aRow['pro_id']).'",';
    $sOutput .= '"'.addslashes($aRow['pro_desc']).'",';
    $sOutput .= '"'.addslashes(date("d/m/y h:i:s",strtotime($aRow['pro_dt_create']))).'"';
    $sOutput .= "],";
    }
    $sOutput = substr_replace( $sOutput, "", -1 );
    $sOutput .= '] }';

    echo $sOutput;
    [/code]

    (with N rows always visible)
    [code]
    $sOutput = '{';
    $sOutput .= '"sEcho": '.$_GET['sEcho'].', ';
    $sOutput .= '"iTotalRecords": '.$iTotal.', ';
    $sOutput .= '"iTotalDisplayRecords": '.$iFilteredTotal.', ';
    $sOutput .= '"aaData": [ ';
    while ( $aRow = mysql_fetch_array( $rResult ) )
    {
    $sOutput .= "[";
    $sOutput .= '"'.addslashes($aRow['pro_id']).'",';
    $sOutput .= '"'.addslashes($aRow['pro_desc']).'",';
    $sOutput .= '"'.addslashes(date("d/m/y h:i:s",strtotime($aRow['pro_dt_create']))).'"';
    $sOutput .= "],";
    }


    // extra rows
    $sOutput .='[';
    $sOutput .='"'.addslashes('x').'",';
    $sOutput .='"'.addslashes('Y').'",';
    $sOutput .='"'.addslashes('Z').'"';
    $sOutput .=']';

    //$sOutput = substr_replace( $sOutput, "", -1 );
    $sOutput .= '] }';

    echo $sOutput;



    [/code]
This discussion has been closed.