Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struts2 JQuery Plugin 4.0.3 - Grid with search/filter issue #178

Open
nitinperi opened this issue Jan 14, 2020 · 0 comments
Open

Struts2 JQuery Plugin 4.0.3 - Grid with search/filter issue #178

nitinperi opened this issue Jan 14, 2020 · 0 comments

Comments

@nitinperi
Copy link

Issue: Grid not retaining the filter criteria applied once it loses the focus if a popup window is open and when the focus come back after user operation. Please see the scenario below.

• User open a page with a list of employee grid on it. User wait till the grid is done loading first time and displaying all the results (100 rows) which are pulled from database.
• User click the Find/Search feature of the grid to Filter/Find particular row/rows based on the Filter criteria for e.g. First Name as ‘John’
• After applying the search criteria, Grid displays 30 rows back with employee whose first name is John.
• User click on the first row and open another popup window where the whole record of John is listed and update the last name.
• User Save the row which also closes the popup window where last name was change and focus goes back to grid.
• The grid reload again but it loose the filter results (first name as John) and bring the whole 100 rows that it brought during the first load.
• This causes user problem as they have to re-apply the filter every time they make a change and save a record and go back to grid.
• User expect the grid to retain the filters unless until the reset is clicked on the grid or the user move out of the page and come back.

We have the following code onCompleteTopic to achieve it. But issue is the event is getting triggered multiple time than what it should be.
$.subscribe('onGridloadComplete_topicname',
function(event, data) {
var parentGrid = data['id'];
var gridVar = $("#" + parentGrid);
var postfilt = gridVar.jqGrid('getGridParam',
'postData').filters;

						if (postfilt != undefined
								&& gridVar.jqGrid("getGridParam",
										"datatype") === "json") {											
							setTimeout(function() {
								
								gridVar.trigger("reloadGrid");
							}, 5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant