when i used onclick in TR tag the Show entries and search and pagination isnt show dor me

when i used onclick in TR tag the Show entries and search and pagination isnt show dor me

mansour161mansour161 Posts: 2Questions: 1Answers: 0


<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box box-primary">
        <div class="box-header">
        </div>
        <!-- /.box-body -->
      <div class="box">
        <div class="box-header">
          <h3 class="box-title">darkhasti</h3>
        </div>
        <!-- /.box-header -->
        <div class="box-body">
          <table id="example1" class="table table-bordered table-striped">
            <thead>
            <tr>
              <th>name</th>  
              <th>titel</th>
              <th>perstart</th>
              <th> az</th>
              <th>taid</th>
              <th>setting</th>
            </tr>
            </thead>
            <tbody>

        <?php 

            $sql1 = "SELECT * from `time` ";
            $faq1 = $db_handle->runQuery($sql1);

            $userid = mysqli_query($cn,"SELECT * FROM `time` ORDER BY `id` DESC ");
            $i=0;
            foreach ($userid as  $key => $value) {

                $nameshe = mysqli_query($cn,"SELECT name FROM `user` where id=$value[iduser] LIMIT 1 ");
                $namesherkat = mysqli_fetch_array($nameshe);

                $az =substr($value['start'],11, 8);

        ?>
            <tr onclick="show_hide_row('hidden<?php echo $i; ?>');">
              <td><?php echo $namesherkat['name']; ?></td>  
              <td><?php echo $value['titel']; ?></td>
              <td><?php echo $value['perstart']; ?></td>
              <!--<td><?php echo $value['perend']; ?></td>-->
              <td><?php echo $az; ?></td>
              <!-- <td><?php echo $ta; ?></td> -->                 
              <td id="tagyir<?php echo $value['id']; ?>"><?php echo $taid; ?></td>
              <td><input type="button" value="<?php echo $valklid; ?>" id="save<?php echo $value['id']; ?>" name="<?php echo $value['namaz']; ?>" class="blue" onclick="ff(<?php echo $value['id']; ?>);"/></td>

            </tr> 
            <tr class="table-row" id="hidden<?php echo $i; ?>"  style="display:none">
            <td id="tagyirtozih<?php echo $value['id']; ?>" colspan=8 contenteditable="true" onBlur="saveToDatabase(this,'discription','<?php echo $faq1[$i]["id"]; ?>')" onClick="showEdit(this);"><?php echo $faq1[$i]["discription"]; ?></td>
            </tr>


        <?php  $i++; } ?> 

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

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,184Questions: 26Answers: 4,925
    Answer ✓

    Take a look at your browser's console for errors. My guess is you have an error stopping the Javascript.

    Kevin

  • mansour161mansour161 Posts: 2Questions: 1Answers: 0

    I am adding 6 thead in the heder of the table but I add 6 rows with 1 row how hidden and when I'm clicking this its show to me

            <thead>
            <tr>
            1-  <th>name</th> 
            2-  <th>titel</th>
            3-  <th>perstart</th>
           4-   <th> az</th>
             5- <th>taid</th>
           6-  <th>setting</th>
            </tr>
            </thead>
    

    ....

                  <tr onclick="show_hide_row('hidden<?php echo $i; ?>');">
                 1 -<td><?php echo $namesherkat['name']; ?></td>  
                2-  <td><?php echo $value['titel']; ?></td>
                 3- <td><?php echo $value['perstart']; ?></td>
                4-  <td><?php echo $az; ?></td>
                 5- <td id="tagyir<?php echo $value['id']; ?>"><?php echo $taid; ?></td>
               6-   <td><input type="button" value="<?php echo $valklid; ?>" id="save<?php echo $value['id']; ?>" name="<?php echo $value['namaz']; ?>" class="blue" onclick="ff(<?php echo $value['id']; ?>);"/></td>
                </tr> 
    
                <tr class="table-row" id="hidden<?php echo $i; ?>"  style="display:none">
              7-  <td id="tagyirtozih<?php echo $value['id']; ?>" colspan=8 contenteditable="true" onBlur="saveToDatabase(this,'discription','<?php echo $faq1[$i]["id"]; ?>')" onClick="showEdit(this);"><?php echo $faq1[$i]["discription"]; ?></td>
                </tr>
    

    this error show to me
    Uncaught TypeError: n is undefined
    into this file it refers to me (DT_CellIndex={row:b,column:p};g.push(n);if(l||) to column

  • kthorngrenkthorngren Posts: 21,184Questions: 26Answers: 4,925

    Looks like you have colspan in the tbody. Datatables doesn't support this. The HTML docs provide the specs for this.

    Kevin

This discussion has been closed.