Multiple table dynamic data call?

Multiple table dynamic data call?

CwiCwi Posts: 2Questions: 0Answers: 0
edited February 2016 in Free community support

Je met en place plusieurs tables dynamiquement avec un id différent pour chaque table.

Je voudrais pour chaque table appeler les data correspondantes via cette id.
Mais je ne trouve pas comment connaitre l'id de la table en cours de traitement.

I use a part of the id for appler my table:
$('[id^=TableRapprochement-]').DataTable({...

I have to pass the id for the call data:
... "+ $ (this) .attr (" id ") ...
but the id of the table is undefined

Someone you an idea?

$(document).ready(function() {

$('[id^=TableRapprochement-]').DataTable({
   "ajax": "import-banque-rapprochement.json.php?"+$(this).attr("id"),
   responsive: true
} );

});

                <?
                // Contenu de chaque onglet
                $i=1;
                foreach($arrAll as $Cle=>$Val){
                    echo '<div id="tab'.$i.'" class="tab-pane '.($i==1?"active":"").'"> ';
                ?>      
                  <!-- row -->
                  <div class="row">
                    <div class="col-md-12">
                     <div class="panel widget">
                       <div class="panel-heading">
                        <h3 class="panel-title  vd_black"> <span class="menu-icon"> <i class="fa fa-dot-circle-o"></i> </span> Liste des opération du compte : <?=$Val['IDCompte']?> </h3>
                       </div>
                       <div class="panel-body-list  table-responsive">
                        <table id="TableRapprochement-<?=$Val['IDCompte']?>" class="table table-striped table-hover no-head-border display">
                          <thead class="vd_bg-green vd_white">
                            <tr>
                             <th>#</th>
                             <th>Username</th>
                             <th>Date registered</th>
                             <th>Role</th>
                             <th>Status</th>
                             <th>Action</th>
                            </tr>
                          </thead>
                        </table>
                       </div>
                     </div>
                    </div>
                    <!-- col-md-12 --> 
                  </div>
                  <!-- row --> 

                <?  // end - Contenu de chaque onglet   
                    echo '</div>';
                    $i++;
                }
                ?>
This discussion has been closed.