jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Setting focus to filter input
This topic contains 5 replies, has 3 voices, and was last updated by emyann 12 years, 2 months ago.
-
Author
-
When filtering client-side within a grid, the keyboard focus stays in the filter input component and I can keep on typing while the filtering changes the contents in my grid. But when I do server-side filtering my focus on the filter input disappears (most likely because I call updatebounddata in my source’s filter function). I do not know how to refocus the keyboard input to my grids filtercomponents.
How do I set focus to a filterinput in my grid?
Is there also a way to slow down the filtering timeout (allowing for longer timeout between keystrokes before the filter functions is called)?Best regards,
Per Eivind Jenssenvar source = {
datatype: “json”,
datafields: [
{ name: ‘Id’ },
{ name: ‘SpecialCode’ },
{ name: ‘Navn’ }
],
async: false,
cache: false,
id: ‘Id’,
url: ‘@Url.Content(“~/myArea/myController/myAction?myParameter=” + @Model.AParameter)’,
filter: function () {
$(“#myGrid”).jqxGrid(‘updatebounddata’); // This updates the data in my grid, but also causes the filter input to loose focus
},
sort: function () {
$(“#myGrid”).jqxGrid(‘updatebounddata’);
}
};Hi JAG7070,
I suggest you to take a look at the Server Filtering samples available online. The focus is Ok there with the latest version of jQWidgets.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi,
I have the same problem than JAG7070, I upgrade my jQWidgets to the last version (2.6.1) but the problem is still here.
I have a jqxgrid built upon jaydata.js framework and I did a server filtering stuff. I have 2 filters, the first one is a textbox with autocomplete mecanism and the second one is a list of choices. http://hpics.li/01fb73a
When I get the server response, I refresh the datagrid data with a “updatebounddata” command but I loose the focus on the textbox and my list filter is reset.
I’ve found a workaround for the list filter with theses methods$organizationDataGrid.jqxGrid('savestate'); $organizationDataGrid.jqxGrid("updatebounddata"); $organizationDataGrid.jqxGrid("loadstate");
but I don’t know how I can keep my focus on my input box.
Any idea ?
Thanks for all.
Hi emyann,
Please, take a look at the implementation of our online samples about server filtering. “updatebounddata” without parameters rebinds and rerenders the Grid i.e that call makes a full refresh. The focus will be lost after a full refresh. That’s why, we added parameters to that function which should be used depending on the scenario – sorting, filtering or sth. else. The server filtering demo uses “updatebounddata” with “filter” parameter.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi emyann,
Please, take a look at the implementation of our online samples about server filtering. “updatebounddata” without parameters rebinds and rerenders the Grid i.e that call makes a full refresh. The focus will be lost after a full refresh. That’s why, we added parameters to that function which should be used depending on the scenario – sorting, filtering or sth. else. The server filtering demo uses “updatebounddata” with “filter” parameter.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHey great !!
I’ve searched for a long time in order to have a parameter like this, but I didn’t find anything at all in the API. Sorry for having disturbed you.
Thank you.
-
AuthorPosts
You must be logged in to reply to this topic.