Closed GoogleCodeExporter closed 9 years ago
You can do this with reloadTopics and formIds attribute:
<s:url id="getCurrentDateLogs" action="getCurrentDateLogs"/>
<sjg:grid
id="getLogs"
dataType="json"
href="%{getCurrentDateLogs}"
gridModel="listOfLogs"
onSelectRowTopics="rowselect"
loadonce="true"
reloadTopics="reloadGrid"
formIds="form2"
>
<sjg:gridColumn name="userid" index="userid" title="User ID" sortable="true" align="center"/>
<sjg:gridColumn name="username" index="username" title="Username" sortable="true"/>
<sjg:gridColumn name="logaction" index="logaction" width="600" title="Action" sortable="true"/>
<sjg:gridColumn name="date" index="date" title="Date" sortable="true" sorttype="date" align="center"/>
<sjg:gridColumn name="time" index="time" title="Time" sortable="true" sorttype="time" align="center"/>
</sjg:grid>
<s:form action="getLogsByDates" id="form2" theme="simple" cssClass="yform">
<table class="">
<tr><td>from:</td>
<td><sj:datepicker value="yesterday" id="from" name="startDate" displayFormat="dd/mm/yy" label="from" /></td>
</tr>
<tr><td>to:</td>
<td><sj:datepicker value="today" id="to" name="endDate" displayFormat="dd/mm/yy" label="to" /></td>
</tr>
<tr><td colspan="2">
<sj:submit
value="Search"
button="true"
onClickTopics="reloadGrid"
indicator="indicator"
/>
</td></tr>
</table>
</s:form>
Original comment by johgep
on 27 Apr 2012 at 5:03
Hello please i have tested this but it does not work can you give an exemple
please
Original comment by laabid...@gmail.com
on 15 May 2012 at 2:23
Hi,
I have the same problem and have tried the above approach. In Chrome, server
returns full json object in text format, while in Firefox, it hangs. Not sure
what could be wrong.
I am using Struts2-core-2.1.8.jar and jquery and jgrid plugin 3.3.1.
Please advise.
Thanks!
Original comment by ramcdwiv...@gmail.com
on 2 Jul 2012 at 1:08
I feel more popular use case could be -
We have a default results in Grid, while have a search form above GRID. When
search form is submitted, reload the GRID with updated results.
I tried doing it but could not releod the Grid, I have explained my issue in
detail here
http://stackoverflow.com/questions/14466984/struts2-jquery-grid-ajax-data-reload
-on-form-submit
Original comment by ghotanka...@gmail.com
on 22 Jan 2013 at 9:05
i have followed suggestion by johgep and it is working. However, it is
refreshing the whole page and when that happens it doesn't stay in that page
but redirect to the homepage. Is there an attribute that i need to set so it
stays in the same page?
thanks a lot for your help.
Original comment by alali...@gmail.com
on 4 Jan 2014 at 2:36
Original issue reported on code.google.com by
tererog...@gmail.com
on 28 Mar 2012 at 4:35