Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

datatables with php mysql and have links or options

$
0
0
Hello loving datatables but have a hard time to make them how i really want usually i make my tables with a repeat or do while, but after testing datatables want to try them im using right now

        <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
                $('#listax').dataTable( {
                    "bProcessing": true,
                    "bServerSide": true,
                    "sAjaxSource": "./datatables.php"
                } );
            } );
        </script>

for my html i have
<div class="block-fluid table-sorting clearfix">
    <table class="table" border="0" cellpadding="0" cellspacing="0" width="100%" id="listax">
    <thead>
      <tr>
        <th class="yy">Title:</th>
        <th class="yy">Slug:</th>
        <th class="yy">Category:</th>
        <th class="yy">Order:</th>
        

      </tr>
      </thead>
      <tbody>

        <tr>
          <td class="xx">&nbsp;</td>
          <td class="xx">&nbsp;</td>
          <td class="xx">&nbsp;</td>
          <td class="xx">&nbsp;</td>
		</tr>

</tbody>
    </table></div>

so far it works great until i try to get my edit and delete buttons my normal way without datatatables is
<table class="Table" border="0" cellpadding="0" cellspacing="0" width="100%">
    <thead>
      <tr>
        <th class="yy">Title:</th>
        <th class="yy">Slug:</th>
        <th class="yy">Category:</th>
        <th class="yy">Order:</th>
       		<th>&nbsp;</th>

      </tr>
      </thead>
      <tbody>
<?php do { ?>
        <tr>
          <td class="xx"><?php echo($row_page['Title']); ?></td>
          <td class="xx"><?php echo($row_page['Slug']); ?></td>
          <td class="xx"><?php echo($row_page['pagecatt']); ?></td>
          <td class="xx"><?php echo($row_page['Order']); ?></td>
          
		<td class="EditButtons" nowrap="nowrap"><input type="button" class="formButton ResultsPageButton DetailButton" value="" onclick="document.location.href='detail.php?id=<?php echo($row_page['id']); ?>
<?php echo(isset($_GET["pageNum_page"])?"&pageNum_page=".intval($_GET["pageNum_page"]):""); ?>';"/><input type="button" class="formButton ResultsPageButton  UpdateButton" value="" onclick="document.location.href='update.php?id=<?php echo($row_page['id']); ?>
<?php echo(isset($_GET["pageNum_page"])?"&pageNum_page=".intval($_GET["pageNum_page"]):""); ?>';"/><input type="button" class="formButton ResultsPageButton  DeleteButton" value="" onclick="document.getElementById('deleteRecordID').value=<?php echo($row_page['id']); ?>;document.getElementById('deleteBox').style.display = 'block';document.getElementById('deleteMessage').style.display = 'table';" /></td>
        </tr>
<?php } while ($row_page = mysql_fetch_assoc($page)); ?>
</tbody>
    </table>    


As you can see i have on my last cell some buttons it can even be links or pictures to edit delete or anything else using the id of each element, how can i do this kind of tables with datatables is it even possible i checked most of the examples but have no clue how to accomplish this any tip please on how i can do it?

O also datatables.php is just exactly as the example just changed the database connection and the tables cells

Viewing all articles
Browse latest Browse all 1816

Latest Images

Trending Articles



Latest Images