This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Web editable table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Web editable table" Watch "Web editable table" New topic
Author

Web editable table

Dmitry Fedorovich
Greenhorn

Joined: Sep 06, 2010
Posts: 8
Good day, guys...
I`m not sure i write in the correct section, but still...

The point is - i`m writing a java web (Servlet based) application, and i need to show the user a data table.
That table should be able to show data, filter it, find by some parameter and even allow user to change data (and data must be changed in database too).

I can write my own HTML table, which sends web requests via AJAX-to-SERVLET way. And in servlet logic select new data, or modify database, BUT. It will take sooo long.

So is there any good and flexible engine with such functionality?
As a resume - i need:
1) Show user data from my database (as a table)
2) Allow user to sort, filter and CHANGE data (data in database also must be changed)
3) It must work through AJAX (no page reload in any user`s action)

Thanks a lot.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

If you can use JQuery, there are some interesting plugins for tables, especially DataTables. Check here.


[My Blog]
All roads lead to JavaRanch
Dmitry Fedorovich
Greenhorn

Joined: Sep 06, 2010
Posts: 8
Yes. But they don`t support editing. Also i need server side logic to manipulate with database. In PHP cake framework can do the trick...
But i`m looking for the same in java...
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

You should use Javascript DOM API for creating a TextNodes filling with Data Dynamically .

Some sample code

This is very basic , you need to do a lot of R&D work on Javascript DOM API to achive this functionality .

If you face any problems , post your questions in HTML and Javacript Forum on Coderanch to get better answers


Save India From Corruption - Anna Hazare.
Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 298
I don't know how that can be achived by using only your own Javascript, but if you don't mind using a library continue reading:

That can be done using ExtJS very easily, check out this example: http://dev.sencha.com/deploy/dev/examples/grid/edit-grid.html

This is the library's site: http://www.sencha.com/products/js/
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Web editable table
 
Similar Threads
How to allow sorting of table?
Ajax with JSP and JSTL
Suggestion for filter saving
Do we need to filter the search result data?
Showing form elements on ajax call