<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="http://cdn.datatables.net/responsive/1.0.1/js/dataTables.responsive.min.js"></script>
<script src="http://cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="http://cdn.datatables.net/1.10.2/css/jquery.dataTables.css" />
</head>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="form-horizontal">
<div class="form-group">
<div class="col-sm-1"> <button type="button" class="btn btn-primary btn-circle btn-xl" 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>Lotes por Clasificar</font></legend></label></div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-horizontal">
<div class="form-group">
<div class="col-md-2 pull-right align=center"> <button type="submit" class="btn btn-primary btn-lg" id="clasificar_lote" title="Clasificar Lote">Clasificar Lote</button> </div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title"> </h3>
<div class="pull-right">
<span class="clickable filter" data-toggle="tooltip" title="Buscar" data-container="body"><i class="glyphicon glyphicon-filter"></i></span>
</div>
</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 display nowrap" id="dev-table" border="0" cellspacing="0">
<thead>
<tr>
<th></th>
<th>#</th>
<th>Lote</th>
<th>Fecha Recepción</th>
<th>Proveedor</th>
<th>Turno</th>
<th>Color</th>
<th>Lbs Remitidas</th>
<th>Lbs Procesadas</th>
<th>Lbs Recibidas</th>
<th>Estado</th>
</tr>
</thead>
<tbody>
<tr data-key-1="Value 1" data-key-1="Value 1">
<td class="details-control"></td>
<td>1</td>
<td>171525</td>
<td>23/05/2016</td>
<td>Moran Jaime</td>
<td>Día</td>
<td>A3</td>
<td>5,000.00</td>
<td>4,250.00</td>
<td>3,448.00</td>
<td>Proceso</td>
</tr>
<tr data-key-1="Value 1" data-key-2="Value 2">
<td class="details-control"></td>
<td>2</td>
<td>171824</td>
<td>23/05/2016</td>
<td>LIMBOMAR S.A.</td>
<td>Noche</td>
<td>A2</td>
<td>28,000.00</td>
<td>18,817.00</td>
<td>19,060.00</td>
<td>Liquidado</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
.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;
}
/*style del group*/
td.details-control {
background: url('https://media.flixfacts.com/inpage/microsoft_hardware/surface4/img/plus_icon_1x.png') no-repeat center center;
cursor: pointer;
}
tr.shown td.details-control {
background: url('https://media.flixfacts.com/inpage/microsoft_hardware/surface4/img/minus_icon_1x.png') no-repeat center center;
}
/*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;
}
/**
* 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();
})
function format ( dataSource ) {
var html = '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">';
html += '<thead>';
for (var key in dataSource){
html += '<tr>'+
'<th>Doc.Referencia</th>'+
'<th>Estatus Cabeza</th>'+
'<th>Sobrante</th>'+
'<th>Lbs Procesadas</th>'+
'<th>Lbs Recibidas</th>'+
'<th>Liquidador</th>'+
'<th>Máquina</th>'+
'<th>Estado</th>'
'<th>' + dataSource[key] +'</td>'+
'</tr>' +
'</thead>'
html += '<tr>'+
' <td><a href="">260272</a></td> '+
'<td>COLA</td>'+
'<td>40.75</td>'+
'<td>1,849.86</td>'+
'<td>1,849.86</td>'+
'<td>Jorge Chang</td>'+
'<td>Máquina 2</td>'+
'<td>Liquidado</td>'+
'</tr>';
html += '<tr>'+
' <td><a href="">115847</a></td> '+
'<td>ENTERO</td>'+
'<td>600.00</td>'+
'<td>7,882.61</td>'+
'<td>7,882.61</td>'+
'<td>Victor Romo</td>'+
'<td>Máquina 3</td>'+
'<td>Liquidado</td>'+
'</tr>';
}
return html += '</table>';
}
/*Script para agrupar*/
$(function () {
var table = $('#dev-table').DataTable({
"searching": false,
"paging": false,
"bInfo" : false
});
// Add event listener for opening and closing details
$('#dev-table').on('click', 'td.details-control', function () {
var tr = $(this).closest('tr');
var row = table.row(tr);
if (row.child.isShown()) {
// This row is already open - close it
row.child.hide();
tr.removeClass('shown');
} else {
// Open this row
row.child(format({
'Key 555' : tr.data('key-1')
})).show();
tr.addClass('shown');
}
});
});