ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi guys , i am lost here because i have no experience in html code , i have been looking on the web for solutions but none of them solved my problem .
I am loading a heavier csv file (7 Megabytes) into an html page and i am using this code :
With this code the database loads fast but i want to add a search box on the html page , how can i do that without changing the current way this html loads the database ?
If it's too much data for a browser to handle then it should not be loaded in one go.
Also, no need to waste bandwidth transferring 7MB of data if someone only wants a fraction of 1% of it.
I'd still recommend DataTables - there's very likely a premade backend in whatever language/framework is preferred (a quick search of PyPi shows plenty of Python options), but it's also pretty easy to configure DataTables to work with an arbitrary/bespoke API.
I do not have adsl to worry about the heavy bandwidth , this is for my internal network witch works on 1Gb lan cards , right now the browser loads all data in 2 seconds , so do not worry about the load .
I want the list to be opened as full and if i decide to search for something then it must be filtered .
I have look at datatables and it looks complicated for my knowledge and it requires sql engine running ,witch i do not want , and php engine to run it .
Please , do not post here more comments about the load of the file to a browser , if i had that issue then i had posted it on my first post .
The main objective is to use javascript to do the job only .
The main objective is to use javascript to do the job only .
One can certainly use JavaScript to add a search field and accept input.
I’m not thinking of a way to easily update an existing already-rendered page to remove non-matching rows. I’d use the input value to filter the source data before (as) you reload the page.
Scasey , what about using the same input box to go back , if there in nothing in input box then database i full , but as soon as a character in entered then it starts filtering .
In the past i used an applet to do all this job and it worked perfectly well , but since flash player was removed from browsers then i was unable to get it working again , despite all those flash player emulators as an extension for web browsers , the database do not work well or at all , this is why i had to search a simple alternative for the job .
Probably found a solution to it while searching in the web now , i have been looking everywhere and this git passed thru me .
It uses python to start the webserver , but probably i will be able to make it work with apache
This github works well with apache but it takes 2 minutes to load all the data and it takes another 2 minutes to filter the request from search box .
This github database was from data tables because all java scripts and CSS have their mark on it . It works for now but if anyone have a more faster idea then it would be nice to test it .
You were given suggestions, but don't want to use them, and were fairly rude about what you "do not" want to see.
A CSV file is NOT a database; it is data. Databases like sqlite and MySQL are purposely written for this purpose. And if you already have a web server running, why is installing PHP and using the wealth of tools available to read databases not something you want?? Especially if this is for an internal website, with a small amount of data. The overhead for even running full-bore MySQL and PHP would be trivial.
Use the right tool for the job, or be happy with what you have.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.