Commit 8ce6f7ff authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update grid/Filter and GridWithFilter to focus on the first field of the selector.

parent 33578cd9
......@@ -313,6 +313,9 @@ Ext.define("Dbui.grid.Filter", {
// reset the grid
me.grid.reset();
// focus on the first field
me.child("field").focus();
},
/**
......
......@@ -62,6 +62,7 @@ Ext.define("Dbui.panel.GridWithFilter", {
// collapse the selectorPanel
me.selectorPanel.collapsed = true;
me.selectorPanel.on("expand", me.onSelectorExpand, me);
// Mask the GridFilter during loading
me.grid.getView().loadMask = Ext.create("Ext.LoadMask", {
......@@ -95,6 +96,27 @@ Ext.define("Dbui.panel.GridWithFilter", {
"use strict";
var me = this;
me.goButton.click();
// do it only when the panel is expanded but not collpased
if (!me.selectorPanel.getCollapsed()) {
me.goButton.click();
}
},
/**
* Handler to focus on the first field of the filter
* when the selector is expand
*
*/
onSelectorExpand: function () {
"use strict";
var me = this,
firstField = me.filter.child("field");
if (Ext.isEmpty(firstField)) {
return;
}
firstField.focus();
}
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment