Datatable Search (via a Searchbar)

Do i need to put the items in the grid or just fill it with the items i can already fill it with the items just be running the whole funcion i made on the grid itself (itts not in the pics above) i tried that but got no where whith how to empty and fill it it would eigther erase everything or give me nothing

this is when i run the script to fill the grid with all the items


it works fine i tried the only video from the forum but got nowhere with it