与bootstrap 3在行动链接上打开模态

时间:2014-08-12 22:57:00

标签: twitter-bootstrap-3 modal-dialog

我尝试在开关操作上打开模型。模态代码似乎没问题,但不是结果! 但它没有用,pb与表? 你有好主意吗 ? ps:代码的一部分。 谢谢

      <table><td>
    <?php
     while ($configuration = osc_db_fetch_array($configuration_query)) {

    if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) {
      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . osc_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
    } else {
      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . osc_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration['configuration_id']) . '\'">' . "\n";
    }
   ?>

       <td class="dataTableContent" align="right">
    <?php
     echo '<a data-toggle="modal" data-target="#myModal_'.$_GET['gID'].'"><a href="' . osc_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration['configuration_id'] . '&action=edit') . '">' . osc_image(DIR_WS_ICONS . 'edit.gif', ICON_EDIT) . '</a>';
     ?>
                 </td>
                </tr>
    <?php
      }
    ?>
                  </table></td>
    <?php
     switch ($action) {
      case 'edit':
                echo '<div class="modal fade" id="myModal_'.$_GET['gID'].'" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                          <div class="modal-content">
                            <div class="modal-header">
                              <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true"><span>&times;</span></button>
                              <h4 class="modal-title" id="myModalLabel">' . TEXT_INFO_EDIT_INTRO .'</h4>
                            </div>
                ';
                echo osc_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save');
                echo '      <div class="modal-body" style="text-align:center;">
                              <br /><strong>' . $cInfo->configuration_title . '</strong><br />' . $cInfo->configuration_description . '<br />' . $value_field .'';
                echo '        <div class="pull-left"  style="padding-left:50px; padding-top:10px;">' . osc_image_submit('button_mini_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . osc_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id) . '"></div><div class="pull-right" style="padding-right:50px; padding-top:10px;">' . osc_image_button('button_mini_cancel.gif', IMAGE_CANCEL) . '</a></div>
                            </div>
                </form>
                          </div>
                        </div>
                      </div>
                ';
       break;
     }
    ?>

生成代码

当我在页面上显示时

              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='http://localhost/configuration.php?gID=1&cID=1&action=edit'">
                <td class="dataTableContent">Shopping name</td>
                <td class="dataTableContent">demon</td>
                <td class="dataTableContent" align="right">
<a data-toggle="modal" data-target="#myModal_1"><a href="http://localhost/configuration.php?gID=1&cID=1&action=edit"><img src="images/icons/edit.gif" border="0" alt="Editer" title="Editer" /></a><img src="images/pixel_trans.gif" border="0" alt="" width="6" height="16" /><img src="images/icon_arrow_right.gif" border="0" alt="" />
                </td>
              </tr>

当我点击按钮编辑时。模态代码似乎没问题,但模态没有出现。 我有这段代码:

             <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='http://localhost/configuration.php?gID=1&cID=1&action=edit'">
                <td class="dataTableContent">Nom de la boutique</td>
                <td class="dataTableContent">demo</td>
                <td class="dataTableContent" align="right">
<a data-toggle="modal" data-target="#myModal_1"><a href="localhost/configuration.php?gID=1&cID=1&action=edit"><img src="images/icons/edit.gif" border="0" alt="Editer" title="Editer" /></a><img src="images/pixel_trans.gif" border="0" alt="" width="6" height="16" /><img src="images/icon_arrow_right.gif" border="0" alt="" />
                </td>
              </tr>

以及

之后的更多内容
<div class="modal fade" id="myModal_1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true"><span>&times;</span></button>
              <h4 class="modal-title" id="myModalLabel">Merci de faire les changements n&eacute;cessaires</h4>
            </div>
<form name="configuration" action="localhost/configuration.php?gID=1&cID=1&action=save" method="post">      <div class="modal-body" style="text-align:center;">
              <br /><strong>Nom de la boutique</strong><br />Veuillez indiquer le nom de votre boutique.<br><br><font color="#FF0000"><b>Note :</b> Ce nom s'affichera dans le contenu des e-mails</font><br><br /><input type="text" name="configuration_value" value=" demo" class="form-control" />        <div class="pull-left"  style="padding-left:50px; padding-top:10px;"><input type="image" src="includes/languages/french/images/buttons/button_mini_update.gif" border="0" alt="Mettre &agrave; jour" title=" Mettre &agrave; jour " />&nbsp;<a href="http://localhost/configuration.php?gID=1&cID=1"></div><div class="pull-right" style="padding-right:50px; padding-top:10px;"><img src="includes/languages/french/images/buttons/button_mini_cancel.gif" border="0" alt="Annuler" title="Annuler" /></a></div>
            </div>
</form>
          </div>
        </div>
      </div>

0 个答案:

没有答案