|
@@ -12,7 +12,7 @@ function getData(queryDTO){
|
|
|
return $.post(url, {stringifiedDTO: JSON.stringify(queryDTO)});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+let arrayResponse = [];
|
|
|
|
|
|
function processData(response){
|
|
|
console.log(response)
|
|
@@ -20,16 +20,18 @@ function processData(response){
|
|
|
alert('No results!')
|
|
|
}
|
|
|
else {
|
|
|
+ arrayResponse = response;
|
|
|
var ll = response.length;
|
|
|
for (var i=0; i<ll; i++) {
|
|
|
let newRow = response[i];
|
|
|
createRow(i, newRow);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+let queryDTO = {};
|
|
|
+
|
|
|
function funzioneRicerca(){
|
|
|
$("#result").html("");
|
|
|
let collection_elementoDaRicercare = document.getElementsByClassName("barraDiRicerca");
|
|
@@ -62,6 +64,7 @@ function funzioneRicerca(){
|
|
|
{
|
|
|
formeLemmi = 1;
|
|
|
}
|
|
|
+
|
|
|
|
|
|
if ((check_tipo == "forma") && (formeLemmi == 0)) {
|
|
|
tipo = "forma";
|
|
@@ -93,10 +96,8 @@ function funzioneRicerca(){
|
|
|
let cooccorrenze = {"distanza": distanza, "stesso_periodo": periodo, "ordinate": ordinate};
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
|
|
|
- let queryDTO = {
|
|
|
+ queryDTO = {
|
|
|
queryList: queryList,
|
|
|
cooccorrenze: cooccorrenze
|
|
|
}
|
|
@@ -109,6 +110,31 @@ function funzioneRicerca(){
|
|
|
|
|
|
}
|
|
|
|
|
|
+function checkContext() {
|
|
|
+ let resulTable = document.getElementById("result");
|
|
|
+ const checkBoxes = resulTable.querySelectorAll('input[type="checkbox"]');
|
|
|
+
|
|
|
+ var selected = [];
|
|
|
+ $('#result input:checked').each(function() {
|
|
|
+
|
|
|
+ var checkNum = $(this).attr('id');
|
|
|
+ selected.push(checkNum);
|
|
|
+ });
|
|
|
+
|
|
|
+ for (var i=0; i<arrayResponse.length; i++) {
|
|
|
+ for (var j=0; j<selected.length; j++) {
|
|
|
+ if (arrayResponse[i]["cod"] == selected[j]) {
|
|
|
+ arrayResponse[i]["selected"] = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ queryDTO["listResults"] = arrayResponse;
|
|
|
+
|
|
|
+
|
|
|
+ console.log(queryDTO);
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
$( document ).ready(function() {
|
|
|
$("select").on("change", function(event) {
|
|
@@ -158,6 +184,7 @@ function createRow(num, elem) {
|
|
|
var forma = elem["forma"];
|
|
|
var lemma = elem["lemma"];
|
|
|
var occ = elem["occ"];
|
|
|
+ var cod = elem["cod"];
|
|
|
|
|
|
var row = document.createElement('div');
|
|
|
row.className = "row height d-flex justify-content-center align-items-center";
|
|
@@ -192,7 +219,7 @@ function createRow(num, elem) {
|
|
|
colSel.className = "col seleziona_elemento";
|
|
|
var inputSel = document.createElement('input');
|
|
|
inputSel.className = "form-check-selected";
|
|
|
- inputSel.id = "seleziona_" + num;
|
|
|
+ inputSel.id = cod;
|
|
|
inputSel.type = "checkbox";
|
|
|
colSel.append(inputSel);
|
|
|
row.append(colSel);
|