Débutant création de plugin

Bonjour,
Je me suis lancé dans la création d’un plugin … qui fonctionne très bien (appel api…etc…) mais je souhaiterais pouvoir séparer mes commandes en fonction de leur type (infos, actions) comme dans cette affichage …


Moi pour le moment dans mon plugin c’est basique … les commandes les unes en dessous des autres …

Comment dois-je procéder ?
Chris94440

Hello.

Si j’ai bien compris tu veux 1 onglet info et un onglet action ?

Dans ton desktop/php/+plugin+.php, il faut insérer un tabpanel pour séparer info et action par exemple :

   <div role="tabpanel" class="tab-pane" id="infotab">
      <a class="btn btn-success btn-sm cmdAction pull-right" data-action="add" style="margin-top:5px;"> <i
         class="fa fa-plus-circle"></i> {{Commandes info}}</a>
      <br/><br/>
      <table id="table_info" class="table table-bordered table-condensed">
         <thead>
            <tr>
               <th>{{Id}}</th>
               <th style="width: 300px;">{{Nom}}</th>  //réorganise ici comme tu veux,
               <th style="width: 300px;">{{Type}}</th>
            </tr>
         </thead>
         <tbody></tbody>
      </table>
   </div>

   <div role="tabpanel" class="tab-pane" id="actiontab">
      <a class="btn btn-success btn-sm cmdAction pull-right" data-action="add" style="margin-top:5px;"> <i
         class="fa fa-plus-circle"></i> {{Commandes action}}</a>
      <br/><br/>
      <table id="table_action" class="table table-bordered table-condensed">
         <thead>
            <tr>
               <th>{{Id}}</th>
               <th style="width: 300px;">{{Nom}}</th>  // réorganise ici idem ou différent de commande info
            </tr>
         </thead>
         <tbody></tbody>
      </table>
   </div>

Dans ton desktop/js/+plugin+.js, dans la function addCmdToTable, insère une condition :

function addCmdToTable(_cmd)
{
    if (!isset(_cmd)) {
        _cmd = {configuration: {}};
    }
if (init(_cmd.type) == 'info') {  //condition si cmd type info
...
$('#table_info tbody').append(tr);     //id de la page php précédente
...
}
...
if (init(_cmd.type) == 'action') { //condition si cmd type action
...
$('#table_action tbody').append(tr);     //id de la page php précédente
...
}
1 « J'aime »

Ok merci je test cela dès que je peux!!!

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.