Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How to add the client filtering function in perl table?

by Sinistral (Monsignor)
on Jun 27, 2013 at 13:05 UTC ( [id://1041010]=note: print w/replies, xml ) Need Help??


in reply to How to add the client filtering function in perl table?

Since you specifically said client filtering of a table, and since your table is HTML, I believe that what you're really looking for is a way for your Perl code to generate simple HTML based on your data set and having a person's web browser do the work of sorting, filtering, and possibly editing. With that in mind, I highly recommend that you use DataTables or similar. I've used DataTables, and there is much documentation on how to do pretty styling, but more to your point, there is a built in API for column filtering.

Current best practice for web applications is to NOT put inline attributes like fonts and colors, relying on CSS to do all styling. Furthermore, you should consider your Perl code as a data source for your tables, and use AJAX to have a web browser send requests using JavaScript and your Perl code return data, probably in a form like JSON for the JavaScript to interpret and display.

To get started quickly, what I would do is to take your code, get rid of the inline styling, just make a syntactically correct table, have your HTML page include DataTables, and use JavaScript to quickly get your sorting and filtering working.

  • Comment on Re: How to add the client filtering function in perl table?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1041010]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found