How do I add paging and search to my express web app
How do I add paging and search to my express web app

I'm struggling to figure out how to use this plugin with my Express web app. The server side examples here use php and I'm using javascript. I need to load data from my database (postgresql), and display it to the user (ejs template). They will need the ability to filter results (I planned on using a form for this) and I need the ability to customize some of the columns: some will have buttons along with returned data etc... Any help is much appreciated. Thank you!
This question has an accepted answers - jump to answer
Answers
Per the forum rules, please link to a page showing the issues that you are having so we can help to debug them.
Allan
Hi,
Sorry for not following the rules here. Let me explain:
Error: Uncaught TypeError: Cannot read property 'length' of undefined
What I'm trying to do: use datatables plugin for pagination and search functionality. I'll have to add some buttons to certain columns/cells but that will come after.
I'm currently using express 4 (ejs) / node js. Most of the examples I see use php so it's a bit difficult since I'm new with express / ajax.
Code: http://pastebin.com/10KdDu1a
Thank you
You are using server-side processing in that code. Have you implemented server-side processing in the server-side script? Without a test case that I can load run and check, I can't say.
Allan
I was actually able to get it going yesterday. I'll put up my example when I'm done for others to reference later.
Sample server side script for everyone (filename.js):
Great - thanks for posting that!
Regards,
Allan