sernet Posted November 7, 2019 Share Posted November 7, 2019 Hi I'm having a problem with the Editor component on the grid columns. I use the editor in a very similar way then the code sample Grid-Filter2, But there is a behavior that has changed and i could not solve it. In the current version of Unigui when the mouse is over the column Header the Editor immediately gains focus. But in older versions this doesn't happen and I need the old behavior. There is a solution to that? I've messed around with the editor component without success. I dont quite know if the problem is clear, but just run the grid-filter2 on the curent version and pass the mouse over the editors of the columns. Then do it on a older version of the unigui and compare de behavior. It seems that there is a setFocus on a mouseOver event somewhere. thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 7, 2019 Share Posted November 7, 2019 3 hours ago, sernet said: In the current version of Unigui when the mouse is over the column Header the Editor immediately gains focus. But in older versions this doesn't happen and I need the old behavior. Hi, Just for the test, try this: UniDBGrid.ClientEvents.ExtEvents -> function reconfigure: function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { columns.forEach(function(col, i) { if (col.fedit) { col.fedit.addListener('focus', function() { sender._fdtFocused=true }); col.fedit.addListener('blur', function() { sender._fdtFocused=false }) } sender.headerCt.items.items[i].ariaEl.addListener('mouseenter', function() { if (col.fedit && !sender._fdtFocused && sender.getX() < col.fedit.focusEl.getX()) { col.fedit.focusEl.focus() } return false; }) }); } Quote Link to comment Share on other sites More sharing options...
sernet Posted November 7, 2019 Author Share Posted November 7, 2019 41 minutes ago, Sherzod said: Just for the test, try this Hi Sherzod. It kinda worked. There is no more automatic focus after one editor is already focused. But it still happens on the first editor that the mouse goes over. On a new opened frame for example. And if i click on the grid(selecting a row or a cell) the focus is set to the grid as normal, but as soon as the mouse passes over a Column Header its editor gains focus immediately again. If i click (using filter2 as reference) in a company name, after the click if the mouse goes over the adress Column Header(or any) its editor gains focus. And this happens on any kind of focus change that's not related to the current grid. Example: I have 2 grids with editors(both with the code provided by you) on the same frame. Passing the mouse over the Column Company on GridA its editor is focused and i can pass the mouse over the other ones and nothing happens (Nice). Then witout clicking, when the mouse goes over the other grid GridB, the first Column Header thats it passes over gains focus. So, it works while the focus is on the grid, every time the focus leaves the grid the first Column Header hovered by the mouse will be focused. Don't get me wrong, it's far better now then before(therefore thank you), but still not ideal. how can we improve the solution? It would be best if the editor only got focused onClick. Thanks again Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 7, 2019 Share Posted November 7, 2019 5 minutes ago, sernet said: It would be best if the editor only got focused onClick. function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { columns.forEach(function(col, i) { /*if (col.fedit) { col.fedit.addListener('focus', function() { sender._fdtFocused=true }); col.fedit.addListener('blur', function() { sender._fdtFocused=false }) }*/ sender.headerCt.items.items[i].ariaEl.addListener('mouseenter', function() { /*if (col.fedit && !sender._fdtFocused && sender.getX() < col.fedit.focusEl.getX()) { col.fedit.focusEl.focus() }*/ return false }) }); } 1 Quote Link to comment Share on other sites More sharing options...
sernet Posted November 7, 2019 Author Share Posted November 7, 2019 Gosh. lightening fast. And now works perfctly the way i wanted, and the way it was back a few versions. But do you know why this was changed between updates? Any way Thank you very much for your support. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 7, 2019 Share Posted November 7, 2019 6 minutes ago, sernet said: But do you know why this was changed between updates? It was related to this: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.