<tfoot id='Ad2Bi'></tfoot>
    1. <legend id='Ad2Bi'><style id='Ad2Bi'><dir id='Ad2Bi'><q id='Ad2Bi'></q></dir></style></legend>
        <i id='Ad2Bi'><tr id='Ad2Bi'><dt id='Ad2Bi'><q id='Ad2Bi'><span id='Ad2Bi'><b id='Ad2Bi'><form id='Ad2Bi'><ins id='Ad2Bi'></ins><ul id='Ad2Bi'></ul><sub id='Ad2Bi'></sub></form><legend id='Ad2Bi'></legend><bdo id='Ad2Bi'><pre id='Ad2Bi'><center id='Ad2Bi'></center></pre></bdo></b><th id='Ad2Bi'></th></span></q></dt></tr></i><div id='Ad2Bi'><tfoot id='Ad2Bi'></tfoot><dl id='Ad2Bi'><fieldset id='Ad2Bi'></fieldset></dl></div>

        • <bdo id='Ad2Bi'></bdo><ul id='Ad2Bi'></ul>

        <small id='Ad2Bi'></small><noframes id='Ad2Bi'>

        通过引导模式传递多个数据

        Passing multiple datas through bootstrap modal(通过引导模式传递多个数据)

              <bdo id='1PyH2'></bdo><ul id='1PyH2'></ul>
                <legend id='1PyH2'><style id='1PyH2'><dir id='1PyH2'><q id='1PyH2'></q></dir></style></legend>
                  <tbody id='1PyH2'></tbody>

                <tfoot id='1PyH2'></tfoot>

                <small id='1PyH2'></small><noframes id='1PyH2'>

                  <i id='1PyH2'><tr id='1PyH2'><dt id='1PyH2'><q id='1PyH2'><span id='1PyH2'><b id='1PyH2'><form id='1PyH2'><ins id='1PyH2'></ins><ul id='1PyH2'></ul><sub id='1PyH2'></sub></form><legend id='1PyH2'></legend><bdo id='1PyH2'><pre id='1PyH2'><center id='1PyH2'></center></pre></bdo></b><th id='1PyH2'></th></span></q></dt></tr></i><div id='1PyH2'><tfoot id='1PyH2'></tfoot><dl id='1PyH2'><fieldset id='1PyH2'></fieldset></dl></div>
                  本文介绍了通过引导模式传递多个数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 data-todo 属性对多个数据执行相同的操作,但它不起作用.你能帮帮我吗?

                  I'm trying to do the same with multiple data, with data-todo attribute, but it doesn't work. Could you help me?

                  JAVASCRIPT:

                  JAVASCRIPT:

                  $(document).on("click", ".open-EditTodo", function () {
                      var todoId = $(this).data('id');
                      var todoName = $(this).data('todo');
                      $(".modal-body #todoId").val( todoId );
                      $(".modal-body $todoName").val( todoName );
                  });
                  

                  HTML:

                  <a href="#editTodoDialog" class="open-EditTodo btn btn-warning" data-toggle="modal" data-id="$todo_id" data-todo="$todo_name">EDIT</a>
                  
                  <div class="modal fade" tabindex="-1" role="dialog" style="margin-top: 200px;" id="editTodoDialog">
                    <div class="modal-dialog" align="center">
                      <div class="modal-content" style="width: 350px;">
                        <div class="modal-header" align="left">
                          <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                          <h4 class="modal-title">Edit to-do:</h4>
                        </div>
                        <div class="modal-body" align="center" style="height: 65px;">
                          <form class="form-inline" role="form" method="post" action="todo.php">
                            <div class="form-group">
                              <input type="text" name="todoName" id="todoName" value="" class="form-control" style="width: 230px;">
                              <input type="hidden" name="todoId" id="todoId" value="">
                              <button type="submit" class="btn btn-warning"><span class="glyphicon glyphicon-edit"></span> Edit</button>
                            </div>
                          </form>
                        </div>
                      </div>
                    </div>
                  </div>
                  

                  顺便说一下,data-id 工作正常,但 data-todo 不行.

                  By the way, data-id works just fine, but data-todo doesn't.

                  推荐答案

                  你可以把这两个数据项放在一起.

                  You can put those two data items together.

                  例如:

                  <a id="todolink" href="#editTodoDialog" class="open-EditTodo btn btn-warning" data-toggle="modal" data-todo='{"id":12,"todo":"xyz"}'>EDIT</a>
                  

                  现在您可以像这样检索数组:

                  Now you can retrieve the array like this:

                  var todoId = $('#todolink').data('todo').id;

                  var todoId = $('#todolink').data('todo').id;

                  var todo = $('#todolink').data('todo').todo;

                  var todo = $('#todolink').data('todo').todo;

                  这篇关于通过引导模式传递多个数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to make rooftext effect and valley text effect in HTML5 (or Fabric.js)(如何在 HTML5(或 Fabric.js)中制作屋顶文字效果和山谷文字效果)
                  Draw border around nontransparent part of image on canvas(在画布上的图像不透明部分周围绘制边框)
                  dragging and resizing an image on html5 canvas(在 html5 画布上拖动图像并调整其大小)
                  What#39;s the difference between a boolean as primitive and a boolean as property of an object?(作为原始对象的布尔值和作为对象属性的布尔值有什么区别?)
                  I want to do animation of an object along a particular path(我想沿特定路径对对象进行动画处理)
                  How to upload image into HTML5 canvas(如何将图像上传到 HTML5 画布中)

                    • <tfoot id='sb5Rj'></tfoot>

                        <small id='sb5Rj'></small><noframes id='sb5Rj'>

                          <bdo id='sb5Rj'></bdo><ul id='sb5Rj'></ul>
                        • <legend id='sb5Rj'><style id='sb5Rj'><dir id='sb5Rj'><q id='sb5Rj'></q></dir></style></legend>

                          1. <i id='sb5Rj'><tr id='sb5Rj'><dt id='sb5Rj'><q id='sb5Rj'><span id='sb5Rj'><b id='sb5Rj'><form id='sb5Rj'><ins id='sb5Rj'></ins><ul id='sb5Rj'></ul><sub id='sb5Rj'></sub></form><legend id='sb5Rj'></legend><bdo id='sb5Rj'><pre id='sb5Rj'><center id='sb5Rj'></center></pre></bdo></b><th id='sb5Rj'></th></span></q></dt></tr></i><div id='sb5Rj'><tfoot id='sb5Rj'></tfoot><dl id='sb5Rj'><fieldset id='sb5Rj'></fieldset></dl></div>
                              <tbody id='sb5Rj'></tbody>