dynamically jquery tabs

Asked

Viewed 663 times

2

good is the following I’m using datatables and when I click a value opens a modal. just wanted to put this open on a new tab and don’t know how to do.

would for example tab main clients where I have a form to search and show the datatables and after clicking open more details open a new tab.

example http://www.igest.pt/igest/

Modal

<div class="modal fade bs-detalhes-modal-lg" id="details" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        </div>
        <div class="modal-body" id="conteudoModal">
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default btn-mini" data-dismiss="modal">Fechar</button>
        </div>
    </div>
</div>

the following script will add a new tab only that does not redirect me to it load (id) is an onclick that receives a value per parameter

    function load(id) {
    $.ajax({
        method: "GET",
        url: "./modals/info.php",
        data: {id: id},
        success: function (data) {
            $('.nav-tabs').append('<li class="nav"> <a href="#detalhes" data-toggle="tab" id="' + id + '" onclick="update(this.id)">'+'Cod' + id + '  <button class="close closeTab" type="button" >×</button></a></li>');
            $('.tab-content').append('<div class="tab-pane active" id="' + id + '"></div>');
            $("#conteudoModal").html(data);
            document.getElementById("show").style.display = "";

        }

    });

    $('#detalhes').tab('active');

    }
  • Post the code here to facilitate the analysis of the crowd.

  • I have no code yet made

  • Where is the example on the site you gave?

  • in the customer listing area, you have to do free testing, then when you click on the magnifying glass opens a new tab

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.