Jump to content

sernet

Recommended Posts

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

filter2.PNG.f5535a0e006ee683b95cc3e29b8748a0.PNG

Link to comment
Share on other sites

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;
        })
    });
}

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
        })
    });
}

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...