tags:

views:

80

answers:

1

I want to reload the table of data from server without refreshing it. How to achieve it using tsruts2 and ajax.?Please help.

A: 

Take a look at the Struts2 jQuery Grid Plugin maybe it helps you out. With this you can together with the Struts2 json Plugin build dynamic AJAX based Tables.

Sample:

<s:url id="remoteurl" action="jsontable"/> 
<sjg:grid 
    id="gridtable" 
    caption="Customer Examples" 
    dataType="json" 
    href="%{remoteurl}" 
    pager="true" 
    gridModel="gridModel"
    rowList="10,15,20"
    rowNum="15"
    rownumbers="true"
>
    <sjg:gridColumn name="id" index="id" title="ID" formatter="integer" sortable="false"/>
    <sjg:gridColumn name="name" index="name" title="Name" sortable="true"/>
    <sjg:gridColumn name="country" index="country" title="Country" sortable="false"/>
    <sjg:gridColumn name="city" index="city" title="City" sortable="false"/>
    <sjg:gridColumn name="creditLimit" index="creditLimit" title="Credit Limit" formatter="currency" sortable="false"/>
</sjg:grid>
jogep