"Tabla con detalle"
Bootstrap 3.1.0 Snippet by olguitac

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <head> <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.css" rel="stylesheet"> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> </head> <div class="container"> <div class="row"> <div class="col-sm-9"> <!-- input<button type="button" class="btn btn-primary btn-circle btn-xl"><i class="glyphicon glyphicon-arrow-left"></i></button> --> <div class="form-horizontal"> <div class="form-group"> <div class="col-md-1"> <button type="button" class="btn btn-primary btn-circle btn-lg" title="Regresar"><i class="glyphicon glyphicon-arrow-left" ></i></button> </div> <div class="col-sm-8"> <label class="control-label" for="textinput"><legend><FONT SIZE=6>Clasificación de Lote</font></legend></label> </div> </div> </div> </div> <br> <br> <div class="col-md-12 col-md-offset-0"> <form class="form-horizontal" role="form"> <fieldset> <div class="form-group"> <label class="col-md-1 control-label" for="textinput">Lote</label> <div class="col-md-1"> <input type="text" placeholder="Lote" class="form-control" text="171824"></div> <div class="col-md-1"> <button type="button" class="btn btn-info btn-circle" title="Consultar"><i class="glyphicon glyphicon-search"></i></button></div> <label class="col-md-1 control-label" for="textinput">Documento:</label> <div class="col-md-1"><label class="form-control" for="textinput" placeholder='13/06/2016' name='lbl_fecha' style="width:100px;"></label> </div> <label class="col-md-2 control-label" for="textinput">Hora Inicio:</label> <div class="col-md-1"> <label class="form-control" for="textinput" placeholder='' name='lbl_Serie' ></label> </div> <label class="col-md-2 control-label" for="textinput">Hora Fin:</label> <div class="col-md-1"> <label class="form-control" for="textinput" placeholder='' name='lbl_Serie' ></label> </div> </div> </fieldset> </form> </div><!-- /.col-lg-12 --> <div class="col-md-12 col-md-offset-0"> <form class="form-horizontal" role="form"> <fieldset> <!-- Form Name --> <!-- Text input--> <label class="col-md-1 control-label" for="textinput">Estatus Cabeza</label> <div class="col-md-2"> <a class="btn btn-primary btn-select btn-select-light"> <input type="hidden" class="btn-select-input" id="" name="" value="" /> <span class="btn-select-value">Seleccione...</span> <span class='btn-select-arrow glyphicon glyphicon-chevron-down'></span> <ul> <li>Entero</li> <li>Cola</li> <li>Entero USA</li> </ul> </a> </div> <label class="col-md-1 control-label" for="textinput">Datos</label> <div class="col-md-2"> <a class="btn btn-primary btn-select btn-select-light"> <input type="hidden" class="btn-select-input" id="" name="" value="" /> <span class="btn-select-value">Seleccione...</span> <span class='btn-select-arrow glyphicon glyphicon-chevron-down'></span> <ul> <li>Copiados</li> <li>Tomados</li> <li>No tomados</li> </ul> </a> </div> <label class="col-md-1 control-label" for="textinput">Máquina</label> <div class="col-md-2"> <a class="btn btn-primary btn-select btn-select-light"> <input type="hidden" class="btn-select-input" id="" name="" value="" /> <span class="btn-select-value">Seleccione...</span> <span class='btn-select-arrow glyphicon glyphicon-chevron-down'></span> <ul> <li>Copiados</li> <li>Tomados</li> <li>No tomados</li> </ul> </a> </div> </fieldset> </form> </div><!-- /.col-lg-12 --> <div class="col-md-12"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Información del Lote</h3> </div> <div class="panel-body"> <input type="text" class="form-control" id="dev-table-filter" data-action="filter" data-filters="#dev-table" placeholder="Buscar" /> </div> <div class="table-responsive"> <table class="table table-hover" id="dev-table"> <thead> <tr> <th>Proveedor</th> <th>Color</th> <th>Fecha Recepción</th> <th>Lbs Remitidas</th> <th>Lbs Procesadas</th> <th>Lbs x Liquidar</th> <th>Estado</th> </tr> </thead> <tbody> <tr> <td>LIMBOMAR S.A.</td> <td>A2</td> <td>24/05/2016</td> <td>3,000</td> <td>1,200</td> <td>1,800</td> <td>Proceso</td> </tr> </tbody> </table> </div> </div> </div> <div class="col-md-12 table-responsive"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Productos Clasificados</h3> </div> <table class="table table-bordered table-hover table-sortable" id="tab_logic"> <thead> <tr > <th class="text-center"> Cód. Producto </th> <th class="text-center"> Producto </th> <th class="text-center"> Talla </th> <th class="text-center"> Cantidad </th> <th class="text-center"> Libras </th> <th>Editar</th> <th>Viajes</th> <th class="text-center" style="border-top: 1px solid #ffffff; border-right: 1px solid #ffffff;"> Eliminar </th> </tr> </thead> <tbody> <tr id='addr0' data-id="0" class="hidden"> <td data-name="cod_producto"> <input type="text" name='txt_codProducto' placeholder='Cód. Producto' class="form-control" style="width:90px;"/> </td> <td data-name="producto"> <label class="form-control" for="textinput" placeholder='Nombre Producto' name='lbl_Producto' style="width:400px;"></label> </td> <td data-name="talla"> <label class="form-control" for="textinput" placeholder='Tarea' name='lbl_talla' style="width:70px;"></label> </td> <td data-name="cantidad"> <input type="text" name='txt_cantidad' placeholder='Cantidad' class="form-control" style="width:120px;"/> </td> <td data-name="Libras"> <label class="form-control" for="textinput" placeholder='Libras' name='lbl_libras' style="width:150px;"></label> </td> <td data-name="editar"> <button nam"edit0" class='btn btn-primary glyphicon glyphicon-edit row-edit' title="Editar"></button> </td> <td data-name="viajes"> <button nam"viaje0" class='btn btn-primary glyphicon glyphicon-shopping-cart' title="Viajes" data-toggle="modal" data-target="#contact" data-original-title></button> </td> <td data-name="del"> <button nam"del0" class='btn btn-danger glyphicon glyphicon-remove row-remove text-center' title="Eliminar"></button> </td> </tr> </tbody> </table> </div> <div class="form-group"> <label class="col-md-1 control-label" for="textinput">Sobrante KVS</label> <div class="col-md-1"> <input type="text" placeholder="Sobrante" class="form-control"></div> <label class="col-md-1 control-label" for="textinput">Observación</label> <div class="col-md-4"> <input type="text" placeholder="Sobrante" class="form-control"></div> <div class="col-md-1"> </div> <div class="col-md-1"> <button type="submit" class="btn btn-floppy-saved btn-md" id="add_row">Agregar Producto</button></div> <div class="col-md-1"> </div> <div class="col-md-1"> <button type="submit" class="btn btn-primary btn-md" id="add_row">Cerrar Clasificación</button> </div> </div> </div> <div class="col-md-12"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Totales de Documento</h3> </div> <div class="panel-body"> <input type="text" class="form-control" id="dev-table-filter" data-action="filter" data-filters="#dev-table" placeholder="Buscar" /> </div> <div class="table-responsive"> <table class="table table-hover" id="dev-table"> <thead> <tr> <th>Lbs. Sobrante</th> <th>Horas trabajadas</th> <th>Lbs. por Hora</th> <th>Lbs. Procesadas</th> <th>Lbs. Recibidas</th> <th>Lbs. Ref. X Clasificar</th> </tr> </thead> <tbody> <tr> <td>647.20</td> <td>2</td> <td>4,758.22</td> <td>8,819.25</td> <td>9,516.45</td> <td>1,500</td> </tr> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="modal fade" id="contact" tabindex="-1" role="dialog" aria-labelledby="contactLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="panel panel-primary"> <div class="panel-heading"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="panel-title" id="contactLabel"><span class="glyphicon glyphicon-info-sign"></span>Viajes</h4> </div> <form action="#" method="post" accept-charset="utf-8"> <div class="modal-body"> <div class="row"> <div class=class="col-md-12"> <label class="col-md-1" for="textinput">Lote</label> <div class="col-md-3"> <input type="text" placeholder="Lote" class="form-control" type="text" style="width:100px" ></div> <label class="col-md-2" for="textinput">Producto</label> <div class="col-md-3"> <input type="text" placeholder="Producto" class="form-control" type="text" ></div> </div> </div> <div class="row"> <div class=class="col-md-12"> <label class="col-md-1" for="textinput">Origen</label> <div class="col-md-3"> <input type="text" placeholder="Origen" class="form-control" type="text" style="width:130px" ></div> <label class="col-md-2" for="textinput">Fecha</label> <div class="col-md-3"> <input type="text" placeholder="Fecha" class="form-control" type="text" style="width:120px" ></div> </div> </div> <!-- <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12"> <textarea style="resize:vertical;" class="form-control" placeholder="Message..." rows="6" name="comment" required></textarea> </div> </div> </div> --> <div class="panel-footer" style="margin-bottom:-14px;"> <input type="submit" class="btn btn-success" value="Send"/> <!--<span class="glyphicon glyphicon-ok"></span>--> <input type="reset" class="btn btn-danger" value="Clear" /> <!--<span class="glyphicon glyphicon-remove"></span>--> <button style="float: right;" type="button" class="btn btn-default btn-close" data-dismiss="modal">Cerrar</button> </div> </div> </div> </div> </div> </div>
/***********CSS DE LOS COMBOS********************************/ .btn-select { position: relative; padding: 0; min-width: 150px; width: 80%; border-radius: 0; margin-bottom: 20px; } .btn-select .btn-select-value { padding: 6px 12px; display: block; position: absolute; left: 0; right: 34px; text-align: left; text-overflow: ellipsis; overflow: hidden; border-top: none !important; border-bottom: none !important; border-left: none !important; } .btn-select .btn-select-arrow { float: right; line-height: 20px; padding: 6px 10px; top: 0; } .btn-select ul { display: none; background-color: white; color: black; clear: both; list-style: none; padding: 0; margin: 0; border-top: none !important; position: absolute; left: -1px; right: -1px; top: 33px; z-index: 999; } .btn-select ul li { padding: 3px 6px; text-align: left; } .btn-select ul li:hover { background-color: #f4f4f4; } .btn-select ul li.selected { color: white; } /* Default Start */ .btn-select.btn-default:hover, .btn-select.btn-default:active, .btn-select.btn-default.active { border-color: #ccc; } .btn-select.btn-default ul li.selected { background-color: #ccc; } .btn-select.btn-default ul, .btn-select.btn-default .btn-select-value { background-color: white; border: #ccc 1px solid; } .btn-select.btn-default:hover, .btn-select.btn-default.active { background-color: #e6e6e6; } /* Default End */ /* Primary Start */ .btn-select.btn-primary:hover, .btn-select.btn-primary:active, .btn-select.btn-primary.active { border-color: #286090; } .btn-select.btn-primary ul li.selected { background-color: #2e6da4; color: white; } .btn-select.btn-primary ul { border: #2e6da4 1px solid; } .btn-select.btn-primary .btn-select-value { background-color: #428bca; border: #2e6da4 1px solid; } .btn-select.btn-primary:hover, .btn-select.btn-primary.active { background-color: #286090; } /* Primary End */ /* Success Start */ .btn-select.btn-success:hover, .btn-select.btn-success:active, .btn-select.btn-success.active { border-color: #4cae4c; } .btn-select.btn-success ul li.selected { background-color: #4cae4c; color: white; } .btn-select.btn-success ul { border: #4cae4c 1px solid; } .btn-select.btn-success .btn-select-value { background-color: #5cb85c; border: #4cae4c 1px solid; } .btn-select.btn-success:hover, .btn-select.btn-success.active { background-color: #449d44; } /* Success End */ /* info Start */ .btn-select.btn-info:hover, .btn-select.btn-info:active, .btn-select.btn-info.active { border-color: #46b8da; } .btn-select.btn-info ul li.selected { background-color: #46b8da; color: white; } .btn-select.btn-info ul { border: #46b8da 1px solid; } .btn-select.btn-info .btn-select-value { background-color: #5bc0de; border: #46b8da 1px solid; } .btn-select.btn-info:hover, .btn-select.btn-info.active { background-color: #269abc; } /* info End */ /* warning Start */ .btn-select.btn-warning:hover, .btn-select.btn-warning:active, .btn-select.btn-warning.active { border-color: #eea236; } .btn-select.btn-warning ul li.selected { background-color: #eea236; color: white; } .btn-select.btn-warning ul { border: #eea236 1px solid; } .btn-select.btn-warning .btn-select-value { background-color: #f0ad4e; border: #eea236 1px solid; } .btn-select.btn-warning:hover, .btn-select.btn-warning.active { background-color: #d58512; } /* warning End */ /* danger Start */ .btn-select.btn-danger:hover, .btn-select.btn-danger:active, .btn-select.btn-danger.active { border-color: #d43f3a; } .btn-select.btn-danger ul li.selected { background-color: #d43f3a; color: white; } .btn-select.btn-danger ul { border: #d43f3a 1px solid; } .btn-select.btn-danger .btn-select-value { background-color: #d9534f; border: #d43f3a 1px solid; } .btn-select.btn-danger:hover, .btn-select.btn-danger.active { background-color: #c9302c; } /* danger End */ .btn-select.btn-select-light .btn-select-value { background-color: white; color: black; } /*******CSS PARA DETALLE PRODUCTOS*****/ .table-sortable tbody tr { cursor: move; } /******************************************************************/ .row{ margin-top:40px; padding: 0 10px; } .clickable{ cursor: pointer; } .panel-heading div { margin-top: -18px; font-size: 15px; } .panel-heading div span{ margin-left:5px; } .panel-body{ display: none; } /*css para boton atrás*/ body{margin:40px;} .btn-circle { width: 30px; height: 30px; text-align: center; padding: 6px 0; font-size: 12px; line-height: 1.428571429; border-radius: 15px; } .btn-circle.btn-lg { width: 50px; height: 50px; padding: 10px 16px; font-size: 18px; line-height: 1.33; border-radius: 25px; } .btn-circle.btn-xl { width: 70px; height: 70px; padding: 10px 16px; font-size: 24px; line-height: 1.33; border-radius: 35px; } /*******CSS PARA DETALLE PRODUCTOS*****/ body { margin-top:20px; } .modal-body:not(.two-col) { padding:0px } .glyphicon { margin-right:5px; } .glyphicon-new-window { margin-left:5px; } .modal-body .radio,.modal-body .checkbox {margin-top: 0px;margin-bottom: 0px;} .modal-body .list-group {margin-bottom: 0;} .margin-bottom-none { margin-bottom: 0; } .modal-body .radio label,.modal-body .checkbox label { display:block; } .modal-footer {margin-top: 0px;} @media screen and (max-width: 325px){ .btn-close { margin-top: 5px; width: 100%; } .btn-results { margin-top: 5px; width: 100%; } .btn-vote{ margin-top: 5px; width: 100%; } } .modal-footer .btn+.btn { margin-left: 0px; } .progress { margin-right: 10px; }
/********************CSS ***********************************/ $(document).ready(function () { $(".btn-select").each(function (e) { var value = $(this).find("ul li.selected").html(); if (value != undefined) { $(this).find(".btn-select-input").val(value); $(this).find(".btn-select-value").html(value); } }); }); $(document).on('click', '.btn-select', function (e) { e.preventDefault(); var ul = $(this).find("ul"); if ($(this).hasClass("active")) { if (ul.find("li").is(e.target)) { var target = $(e.target); target.addClass("selected").siblings().removeClass("selected"); var value = target.html(); $(this).find(".btn-select-input").val(value); $(this).find(".btn-select-value").html(value); } ul.hide(); $(this).removeClass("active"); } else { $('.btn-select').not(this).each(function () { $(this).removeClass("active").find("ul").hide(); }); ul.slideDown(300); $(this).addClass("active"); } }); $(document).on('click', function (e) { var target = $(e.target).closest(".btn-select"); if (!target.length) { $(".btn-select").removeClass("active").find("ul").hide(); } }); /***********************************************/ /* Please consider that the JS part isn't production ready at all, I just code it to show the concept of merging filters and titles together ! */ $(document).ready(function(){ $('.filterable .btn-filter').click(function(){ var $panel = $(this).parents('.filterable'), $filters = $panel.find('.filters input'), $tbody = $panel.find('.table tbody'); if ($filters.prop('disabled') == true) { $filters.prop('disabled', false); $filters.first().focus(); } else { $filters.val('').prop('disabled', true); $tbody.find('.no-result').remove(); $tbody.find('tr').show(); } }); $('.filterable .filters input').keyup(function(e){ /* Ignore tab key */ var code = e.keyCode || e.which; if (code == '9') return; /* Useful DOM data and selectors */ var $input = $(this), inputContent = $input.val().toLowerCase(), $panel = $input.parents('.filterable'), column = $panel.find('.filters th').index($input.parents('th')), $table = $panel.find('.table'), $rows = $table.find('tbody tr'); /* Dirtiest filter function ever ;) */ var $filteredRows = $rows.filter(function(){ var value = $(this).find('td').eq(column).text().toLowerCase(); return value.indexOf(inputContent) === -1; }); /* Clean previous no-result if exist */ $table.find('tbody .no-result').remove(); /* Show all rows, hide filtered ones (never do that outside of a demo ! xD) */ $rows.show(); $filteredRows.hide(); /* Prepend no-result row if all rows are filtered */ if ($filteredRows.length === $rows.length) { $table.find('tbody').prepend($('<tr class="no-result text-center"><td colspan="'+ $table.find('.filters th').length +'">No result found</td></tr>')); } }); }); /**SCRIPT DE DETALLE PRODUCTO*/ $(document).ready(function() { $("#add_row").on("click", function() { // Dynamic Rows Code // Get max row id and set new id var newid = 0; $.each($("#tab_logic tr"), function() { if (parseInt($(this).data("id")) > newid) { newid = parseInt($(this).data("id")); } }); newid++; var tr = $("<tr></tr>", { id: "addr"+newid, "data-id": newid }); // loop through each td and create new elements with name of newid $.each($("#tab_logic tbody tr:nth(0) td"), function() { var cur_td = $(this); var children = cur_td.children(); // add new td and element if it has a nane if ($(this).data("name") != undefined) { var td = $("<td></td>", { "data-name": $(cur_td).data("name") }); var c = $(cur_td).find($(children[0]).prop('tagName')).clone().val(""); c.attr("name", $(cur_td).data("name") + newid); c.appendTo($(td)); td.appendTo($(tr)); } else { var td = $("<td></td>", { 'text': $('#tab_logic tr').length }).appendTo($(tr)); } }); // add delete button and td /* $("<td></td>").append( $("<button class='btn btn-danger glyphicon glyphicon-remove row-remove'></button>") .click(function() { $(this).closest("tr").remove(); }) ).appendTo($(tr)); */ // add the new row $(tr).appendTo($('#tab_logic')); $(tr).find("td button.row-remove").on("click", function() { $(this).closest("tr").remove(); }); }); // Sortable Code var fixHelperModified = function(e, tr) { var $originals = tr.children(); var $helper = tr.clone(); $helper.children().each(function(index) { $(this).width($originals.eq(index).width()) }); return $helper; }; $(".table-sortable tbody").sortable({ helper: fixHelperModified }).disableSelection(); $(".table-sortable thead").disableSelection(); $("#add_row").trigger("click"); }); /*****/ /** * I don't recommend using this plugin on large tables, I just wrote it to make the demo useable. It will work fine for smaller tables * but will likely encounter performance issues on larger tables. * * <input type="text" class="form-control" id="dev-table-filter" data-action="filter" data-filters="#dev-table" placeholder="Filter Developers" /> * $(input-element).filterTable() * * The important attributes are 'data-action="filter"' and 'data-filters="#table-selector"' */ (function(){ 'use strict'; var $ = jQuery; $.fn.extend({ filterTable: function(){ return this.each(function(){ $(this).on('keyup', function(e){ $('.filterTable_no_results').remove(); var $this = $(this), search = $this.val().toLowerCase(), target = $this.attr('data-filters'), $target = $(target), $rows = $target.find('tbody tr'); if(search == '') { $rows.show(); } else { $rows.each(function(){ var $this = $(this); $this.text().toLowerCase().indexOf(search) === -1 ? $this.hide() : $this.show(); }) if($target.find('tbody tr:visible').size() === 0) { var col_count = $target.find('tr').first().find('td').size(); var no_results = $('<tr class="filterTable_no_results"><td colspan="'+col_count+'">No results found</td></tr>') $target.find('tbody').append(no_results); } } }); }); } }); $('[data-action="filter"]').filterTable(); })(jQuery); $(function(){ // attach table filter plugin to inputs $('[data-action="filter"]').filterTable(); $('.container').on('click', '.panel-heading span.filter', function(e){ var $this = $(this), $panel = $this.parents('.panel'); $panel.find('.panel-body').slideToggle(); if($this.css('display') != 'none') { $panel.find('.panel-body input').focus(); } }); $('[data-toggle="tooltip"]').tooltip(); }) $(document).ready(function() { var panels = $('.vote-results'); var panelsButton = $('.dropdown-results'); panels.hide(); //Click dropdown panelsButton.click(function() { //get data-for attribute var dataFor = $(this).attr('data-for'); var idFor = $(dataFor); //current button var currentButton = $(this); idFor.slideToggle(400, function() { //Completed slidetoggle if(idFor.is(':visible')) { currentButton.html('Hide Results'); } else { currentButton.html('View Results'); } }) }); });

Related: See More


Questions / Comments: