Commit 1f31a56b by Billy Larru

usando handsontable

parent 636fe850
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package asistencia.servlets;
import java.util.HashMap;
import java.util.List;
import static java.util.stream.Collectors.toList;
import org.json.JSONArray;
import org.json.JSONObject;
public class NewClass {
public static void main(String[] args) {
JSONArray arr = new JSONArray();
JSONObject obj = new JSONObject();
obj.put("nombre", "billy");
obj.put("apellido", "larru");
arr.put(obj);
JSONObject obj2 = new JSONObject();
obj2.put("nombre", "felipe");
obj2.put("apellido", "escala");
arr.put(obj2);
JSONObject obj3 = new JSONObject();
obj3.put("nombre", "");
obj3.put("apellido", "escala");
arr.put(obj3);
System.out.println(arr.toList().get(0).getClass().getTypeName());
List<HashMap> list = arr.toList().stream().filter(HashMap.class::isInstance).map(HashMap.class::cast).collect(toList());
List<HashMap<String, String>> list2 = (List<HashMap<String, String>>)(Object)list;
// list.stream().filter(h -> h.entrySet().stream().filter(e -> e.g) );
// HashMap<String, String> map = list.get(0);
// map.entrySet().stream().filter(e -> e.get)
// list2.forEach(h -> h.entrySet().stream().filter(e -> e.getKey().equals("nombre") &&!e.getValue().isEmpty()).forEach(e -> System.out.println("e="+e.getKey()+ " "+e.getValue())));
System.out.println(list);
List<HashMap<String, String>> listmap = (List<HashMap<String, String>>)(Object)arr.toList();
listmap.forEach(
h -> h.entrySet().stream()
.filter(e -> e.getKey().equals("nombre") && !e.getValue().isEmpty())
.forEach(e -> System.out.println("k="+e.getKey()+", v="+e.getValue()))
);
}
}
......@@ -51,8 +51,8 @@
<div class="panel-heading">
<h6 class="panel-title" style="font-size: 15px; font-family: inherit"><i class="icon icon-search4"></i>&nbsp;ASISTENCIAS PROYECTADAS</h6>
</div>
<div>
<table class="table table-responsive dataTable table-striped table-sm table-bordered" id="tblAsistenciaPolicias">
<div id="tblProyectado">
<!-- <table class="table table-responsive dataTable table-striped table-sm table-bordered" id="tblAsistenciaPolicias">
<thead>
<tr>
<th class="text-center">N°</th>
......@@ -69,7 +69,7 @@
<tbody>
</tbody>
</table>
</table>-->
</div>
</div>
</div>
......@@ -83,11 +83,12 @@
<%@include file="templates/footer-body.jsp"%>
<!--js de la pagina-->
<script src="../plantilla/assets/js/plugins/ui/moment/moment.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/pickers/daterangepicker.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js"></script>
<script src="../plantilla/assets/js/plugins/tables/datatables/datatables.min.js" type="text/javascript"></script>
<script src="../js/lib/dataTables.rowsGroup.js" type="text/javascript"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/tables/handsontable/handsontable.min.js"></script>
<script src="../js/pages/proyectar_asistencia_policias.js" type="text/javascript"></script>
<!--js-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment