开发者

Question on getting data from AJAX

开发者 https://www.devze.com 2023-04-01 18:00 出处:网络
I have a pagination table which has controls like left arrow/right arrow and a text box to directl开发者_JAVA百科y enter any page number.

I have a pagination table which has controls like left arrow/right arrow and a text box to directl开发者_JAVA百科y enter any page number. Below that there is a table with 5 cols and 5 rows

Now I want to update the column data each time the user does any action (e.g. left arrow pressed) without refreshing the page. So I am obviously looking for an AJAX based solution (can be with a combination of jQuery or DWR, etc)

But my main question is this; Since the table structure (HTML code) is already part of a JSP and I only need to replace the data in multiple places, do I have to make multiple AJAX requests OR it can be handled with just 1 AJAX request? If yes, please let me know how it can be done.


Try jquery Flexigrid


How about split the table part to another jsp and include it to your main jsp? When user changing page then you make ajax request to retrieve data and set the view to your new jsp file. Then replace the table with new html data you get back from ajax.

But if your table need more feature like sort column or anything else then I recommend you to use existing grid in JQuery.


I suggest you don't try to re-invent the wheel, but use a ready-made grid plugin.
there are a lot (see the links here).
I've used jqgrid with much success.

0

精彩评论

暂无评论...
验证码 换一张
取 消