JavaScript Hide rows in table A that appear in table B hide rows table jquery,hide rows table html,hide rows

I have Table (Employees) A:

+----+---------+
| ID | NAME    |
+----+---------+
| 1  | ROBERT  |
| 2  | JAMES   |
| 3  | RICHARD |
| 4  | KANYE   |
| 5  | DYLAN   |
| 6  | JOHN    |
| 7  | JEAN    |
| 8  | LOKI    |
| 9  | ADAM    |
+----+---------+

And Table (Employees) B:

+----+---------+
| ID | NAME    |
+----+---------+
| 1  | ROBERT  |
| 2  | JAMES   |
| 3  | RICHARD |
| 4  | KANYE   |
| 5  | DYLAN   |
+----+---------+

Those people are my "employees". The names from table B are all the employees on my database and the names from table A are all the employees that I've assigned to project n°1.

I would like to HIDE all names in Table B that already appear in Table A because I don't want to re-assign the same employee to project n°1.

How can I resolve this using jQuery?

Answer:1

a clientside check would be:

function compareLists(listA, listB){
 var resultList = [];
   listA.forEach(function(itemA){
     listB.forEach(function(itemB){
        if (itemB.name !== itemA.name)resultList.push(itemB);
     }
   }
 return resultList;  
}

or at the serverside (database):

select * from table_b where name not in (select name from table_a)

greetings

Answer:2

Normally you should do that on the server side using SQL as already answered. However, since you ask about javascript. This is the way to filter it at client side:

//collect list of names in A
var table = document.getElementById("TableA");
var names = []
for (var i = 0, row; row = table.rows[i]; i++) {
    names.push(row.celss[1]);
}
//check names in B
table = document.getElementById("TableB");
for (var i = 0, row; row = table.rows[i]; i++) {
    if(jQuery.inArray(row.cells[1], names) !== -1){
        //show row
    }else{
        //hide row
    }
}
Answer:3

I have the following path: /s/STRINGINEED/abcdef/ How should I structure my regex to match STRINGINEED as a result? /s/ is a fixed path, so I would like to get any string between /s/ and the ...

I have the following path: /s/STRINGINEED/abcdef/ How should I structure my regex to match STRINGINEED as a result? /s/ is a fixed path, so I would like to get any string between /s/ and the ...

  1. find specific string in excel
  2. find specific string in python
  3. find specific string in list python
  4. find specific string in php
  5. find specific string regex
  6. find specific string in linux
  7. find specific string in excel cell
  8. find specific string matlab
  9. find specific string in file python
  10. find specific string in c#
  11. find specific string in file linux
  12. find specific string in array javascript
  13. find specific string in sql
  14. find specific string in text file powershell
  15. find specific string in all files linux
  16. find specific string in javascript
  17. find specific string in stored procedure
  18. find specific string in sql database
  19. find specific string in r
  20. find specific string in jquery

I want to call two functions passes via props on click. Note that both of them need arguments of their own. After a bit of searching on Stack Overflow, I found this solution: onclick={()=>{ f1(); ...

I want to call two functions passes via props on click. Note that both of them need arguments of their own. After a bit of searching on Stack Overflow, I found this solution: onclick={()=>{ f1(); ...

  1. react call multiple functions onclick
  2. react call multiple apis
  3. react call multiple functions onchange
  4. react call setstate multiple times
  5. react call render multiple times
  6. react native call multiple api
  7. react componentdidmount called multiple times
  8. react onclick multiple call
  9. react call two functions onclick
  10. calling multiple functions onclick react

Rather than use the likes of Redis, or even LokiJS (which looks great), can I just create a large javascript collection in memory as my app runs, and query that instead?

Rather than use the likes of Redis, or even LokiJS (which looks great), can I just create a large javascript collection in memory as my app runs, and query that instead?

I am having a big array (length:10k) of coordinates (rawData = [x,y1,y2,y3,...]) as follows: rawData = [ {x: 1, y1: 1, y2: 13, y3: 2}, {x: 2, y1: 2, y2: 23, y3: 2}, {x: 3, y1: 3, y2: 33, ...

I am having a big array (length:10k) of coordinates (rawData = [x,y1,y2,y3,...]) as follows: rawData = [ {x: 1, y1: 1, y2: 13, y3: 2}, {x: 2, y1: 2, y2: 23, y3: 2}, {x: 3, y1: 3, y2: 33, ...