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

grid is corrupted on keypress in filter box #149

Open
andymartin opened this issue Feb 27, 2018 · 0 comments
Open

grid is corrupted on keypress in filter box #149

andymartin opened this issue Feb 27, 2018 · 0 comments

Comments

@andymartin
Copy link

Using the following grid configuration, when I press any key in the filter box -- including tab and backspace -- even when the box is empty -- causes the visible grid rows to change. Expected behavior: rows should only change when filter is modified.

var historyColumnModel = [
	{
		title: "Timestamp", dataIndx: "Timestamp", dataType: "date", editable: false, width: "80",
	},
	{
		title: "User Name", dataIndx: "UserName", editable: false, 
		filter: { type: 'textbox', condition: 'contain', listeners: ['keyup'] },
	},
	{
		title: "Machine Name", dataIndx: "MachineName", editable: false,
		filter: { type: "textbox", condition: 'contain', listeners: ['keyup'] }
	},
	{
		title: "Type Name", dataIndx: "TypeName", editable: false,
		filter: { type: "textbox", condition: 'contain', listeners: ['keyup'] }
	},
	{
		title: "Property Name", dataIndx: "PropertyName", editable: false,
		filter: { type: "textbox", condition: 'contain', listeners: ['keyup'] }
	},
	{
		title: "Sample Count", dataIndx: "Count", editable: false
	}
];

function configurePropertyHistoryPqGrid(data) {
	var obj = {
		colModel: historyColumnModel,
		dataModel: {
			location: "local",
			sorting: "local",
			data: data,
			sortIndx: ["Timestamp"],
			sortDir: ["down"],
			editable: false
		},
		minWidth: 600,
		height: 400,
		scrollModel: { autoFit: true },
		selectionModel: { type: '' },
		filterModel: { on: true, mode: "AND", header: true },
		resizable: true,
		columnBorders: true,
		pageModel: { type: "local", rPP: 20, strRpp: "{0}", strDisplay: "{0} to {1} of {2}" }
	};

	var historyGrid = $("#property-history-grid").pqGrid(obj);
	var grid = historyGrid.pqGrid("getInstance").grid;
	grid.refreshDataAndView();
	grid.hideLoading();
}
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