• 19-08-2015, 14:30:18
    #1
    Merhabalar,
    http://datatables.net/examples/basic...iguration.html

    adresindeki örneği bir türlü yapamıyorum. Arama, sayfalama vb. kendisi yapıyor yazıyor sitede ama hiçbir şey olmuyor, yanlışlık nerededir bilgi rica ederim.


    <link rel="stylesheet" type="text/css" href="../css/datatables.min.css">
    		<script src="../js/jquery-1.11.3.min.js"></script>
    		<script src="../js/datatables.min.js"></script>
    
    <script type="text/javascript" class="init">
    
    
    $(document).ready(function() {
    	$('makina').DataTable();
    } );
    </script>
     <form><table id="makina" class="display" width="600" border="1">
                     <thead>
                <tr>
          <th scope="row">KODU</th>
          <th>TANIM</th>
          <th>TONAJ</th>
          <th>MARKA</th>
          <th>MODEL</th>
          <th>YIL</th>
                </tr>
              </thead>
    
                     <?php do { ?>
                     <tbody>
                       <tr>
                         <th scope="row"><?php echo $row_RsMakinaList['Kodu']; ?></th>
                         <td><?php echo $row_RsMakinaList['MakinaTanim']; ?></td>
                         <td><?php echo $row_RsMakinaList['Tonaj']; ?></td>
                         <td><?php echo $row_RsMakinaList['Marka']; ?></td>
                         <td><?php echo $row_RsMakinaList['Model']; ?></td>
                         <td><?php echo $row_RsMakinaList['Yil']; ?></td>
                       </tr>
                     </tbody>
                       <?php } while ($row_RsMakinaList = mysql_fetch_assoc($RsMakinaList)); ?>
                    </table>
    </form></div>
  • 19-08-2015, 14:48:18
    #2
    seçicinin başında # olmalı

    yani $('#makina').DataTable();
  • 19-08-2015, 15:29:15
    #3
    datatable.net tablosunu kullanmaya çalışıyorum. ServerSide açıklamalarını okudum fakat şu anda hiç bir hata vermiyor ve verileri getirmiyor.

    <script type="text/javascript" class="init">
    $(document).ready(function() {
        $('#makina').DataTable( {
            "serverSide": true,
            "ajax": "server_porcessing.php"
    		    } );
    } );
    	</script>
    
    
    <form><table id="makina" class="display" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>id</th>
                    <th>Makina Kodu</th>
                    <th>Makina Tanım</th>
                    <th>Tonaj</th>
                    <th>Marka</th>
                    <th>Model</th>
                    <th>Yıl</th>
                    <th>Vida Tipi</th>
    				<th>Açıklama</th>
                </tr>
            </thead>
     
            <tfoot>
                <tr>
    
                    <th>id</th>
                    <th>Makina Kodu</th>
                    <th>Makina Tanım</th>
                    <th>Tonaj</th>
                    <th>Marka</th>
                    <th>Model</th>
                    <th>Yıl</th>
                    <th>Vida Tipi</th>
    				<th>Açıklama</th>           </tr>
            </tfoot>
        </table>
    </form>


    SERVER_PROCESSING.PHP



    <?php
     
    /*
     * DataTables example server-side processing script.
     *
     * Please note that this script is intentionally extremely simply to show how
     * server-side processing can be implemented, and probably shouldn't be used as
     * the basis for a large complex system. It is suitable for simple use cases as
     * for learning.
     *
     * See http://datatables.net/usage/server-side for full details on the server-
     * side processing requirements of DataTables.
     *
     * @license MIT - http://datatables.net/license_mit
     */
     
    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     * Easy set variables
     */
     
    // DB table to use
    $table = 'machines';
     
    // Table's primary key
    $primaryKey = 'id';
     
    // Array of database columns which should be read and sent back to DataTables.
    // The `db` parameter represents the column name in the database, while the `dt`
    // parameter represents the DataTables column identifier. In this case simple
    // indexes
    $columns = array(
        array( 'db' => 'id', 'dt' => 0 ),
    	array( 'db' => 'Kodu', 'dt' => 1 ),
        array( 'db' => 'MakinaTanim', 'dt' => 2 ),
        array( 'db' => 'Tonaj', 'dt' => 3 ),
        array( 'db' => 'Marka', 'dt' => 4 ),
    	array( 'db' => 'Model', 'dt' => 5 ),
    	array( 'db' => 'Yil', 'dt' => 6 ),
    	array( 'db' => 'VidaTipi', 'dt' => 7 ),
    	array( 'db' => 'Aciklama', 'dt' => 8 )
        
    );
     
    // SQL server connection information
    $sql_details = array(
        'user' => 'root',
        'pass' => '',
        'db'   => 'en',
        'host' => 'localhost'
    );
     
     
    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     * If you just want to use the basic configuration for DataTables with PHP
     * server-side, there is no need to edit below this line.
     */
     
    //require( 'ssp.class.php' );
     
    //echo json_encode(
      //  SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
    //);
    
    ?>
  • 23-08-2015, 15:26:54
    #4
    istizan adlı üyeden alıntı: mesajı görüntüle
    datatable.net tablosunu kullanmaya çalışıyorum. ServerSide açıklamalarını okudum fakat şu anda hiç bir hata vermiyor ve verileri getirmiyor.

    <script type="text/javascript" class="init">
    $(document).ready(function() {
        $('#makina').DataTable( {
            "serverSide": true,
            "ajax": "server_porcessing.php"
    		    } );
    } );
    	</script>
    
    
    <form><table id="makina" class="display" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>id</th>
                    <th>Makina Kodu</th>
                    <th>Makina Tanım</th>
                    <th>Tonaj</th>
                    <th>Marka</th>
                    <th>Model</th>
                    <th>Yıl</th>
                    <th>Vida Tipi</th>
    				<th>Açıklama</th>
                </tr>
            </thead>
     
            <tfoot>
                <tr>
    
                    <th>id</th>
                    <th>Makina Kodu</th>
                    <th>Makina Tanım</th>
                    <th>Tonaj</th>
                    <th>Marka</th>
                    <th>Model</th>
                    <th>Yıl</th>
                    <th>Vida Tipi</th>
    				<th>Açıklama</th>           </tr>
            </tfoot>
        </table>
    </form>


    SERVER_PROCESSING.PHP



    <?php
     
    /*
     * DataTables example server-side processing script.
     *
     * Please note that this script is intentionally extremely simply to show how
     * server-side processing can be implemented, and probably shouldn't be used as
     * the basis for a large complex system. It is suitable for simple use cases as
     * for learning.
     *
     * See http://datatables.net/usage/server-side for full details on the server-
     * side processing requirements of DataTables.
     *
     * @license MIT - http://datatables.net/license_mit
     */
     
    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     * Easy set variables
     */
     
    // DB table to use
    $table = 'machines';
     
    // Table's primary key
    $primaryKey = 'id';
     
    // Array of database columns which should be read and sent back to DataTables.
    // The `db` parameter represents the column name in the database, while the `dt`
    // parameter represents the DataTables column identifier. In this case simple
    // indexes
    $columns = array(
        array( 'db' => 'id', 'dt' => 0 ),
    	array( 'db' => 'Kodu', 'dt' => 1 ),
        array( 'db' => 'MakinaTanim', 'dt' => 2 ),
        array( 'db' => 'Tonaj', 'dt' => 3 ),
        array( 'db' => 'Marka', 'dt' => 4 ),
    	array( 'db' => 'Model', 'dt' => 5 ),
    	array( 'db' => 'Yil', 'dt' => 6 ),
    	array( 'db' => 'VidaTipi', 'dt' => 7 ),
    	array( 'db' => 'Aciklama', 'dt' => 8 )
        
    );
     
    // SQL server connection information
    $sql_details = array(
        'user' => 'root',
        'pass' => '',
        'db'   => 'en',
        'host' => 'localhost'
    );
     
     
    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     * If you just want to use the basic configuration for DataTables with PHP
     * server-side, there is no need to edit below this line.
     */
     
    //require( 'ssp.class.php' );
     
    //echo json_encode(
      //  SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
    //);
    
    ?>
    "ajax": "server_porcessing.php"
    SERVER_PROCESSING.PHP

    genelde yorgunlukla böyle hatalar yapıldığından kodlara bakmadan yanıt hakkımı bu taraftan kullanmak istedim
    bir de <script src="../js/jquery-1.11.3.min.js"></script>
    <script src="../js/datatables.min.js"></script> şu yollar doğru mu kontrol edin lütfen.
  • 24-08-2015, 09:46:46
    #5
    çok teşekkürler bir yanlışlık yapmışız hakikaten fakat şimdi şöyle bir hata var. Undefined index columns
    Undefined index draw

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 09:46:46 -->-> Daha önceki mesaj 09:23:17 --

    Çok ilginç. Üşenmedim çalışmayı sildim, baştan yaptım hiç sorunsuz çalıştı. Çok teşekkürler.