Jump to content

How to make a column (Action Column) not focusable in a UniDbGrid?


Stemon63

Recommended Posts

Hi,

on UniDBGrid: how to avoid executing the actionclick event on an actioncolumn type column when I press enter on the column?
Or better, how to make a column not focusable? Non selectable when navigate with tabs or arrows?
I cannot permits to press Enter on a "Delete" ActionColumn, but only click or double click.
Thanks in advance

Link to comment
Share on other sites

2 hours ago, Stemon63 said:

on UniDBGrid: how to avoid executing the actionclick event on an actioncolumn type column when I press enter on the column?
Or better, how to make a column not focusable? Non selectable when navigate with tabs or arrows?
I cannot permits to press Enter on a "Delete" ActionColumn, but only click or double click.

Hello,

You can try this approach:

UniDBGrid -> ClientEvents -> ExtEvents ->

function beforereconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    columns.forEach(function(col) {
        if (col.xtype && col.xtype == "actioncolumn") {
            col.itemTabIndex = -1
        }
    });
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 4 weeks later...
15 minutes ago, Stemon63 said:

sorry but it don't works.

Hi,

Please clarify what is not working?

On 4/19/2022 at 11:54 PM, Sherzod said:

You can try this approach:

UniDBGrid -> ClientEvents -> ExtEvents ->

function beforereconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    columns.forEach(function(col) {
        if (col.xtype && col.xtype == "actioncolumn") {
            col.itemTabIndex = -1
        }
    });
}

Works for me.

Please specify which build are you using?

And otherwise make a simple testcase to check.

Link to comment
Share on other sites

  • 1 month later...

Hello @Sherzod

I tried to make the same function to the WidgetColumn but it didn't work

function beforereconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    columns.forEach(function(col) {
        if (col.xtype && col.xtype == "widgetcolumn") {
            col.itemTabIndex = -1
        }
    });
}

 

Any Idea how to make it

 

Regards

Bahry

Link to comment
Share on other sites

42 minutes ago, bahry said:

even If I made the cell read only the focus will go to it

function select(sender, record, index, eOpts)
{
    var widgetColIdx = 1; /*for example UniButtonWidget colIndex = 1*/
    var grid = this.ownerGrid;
    var colIdx = eOpts;
    var rowIdx = index;
    var incIdx = 1; /*for example Increment Column Index = 1*/
    
    if (colIdx == widgetColIdx) {
        Ext.defer(function(){
            grid.getNavigationModel().setPosition(rowIdx, colIdx+incIdx);
            grid.getSelectionModel().select({row: rowIdx, column: colIdx+incIdx});
            grid.getSelectionModel().setCurrentPosition({row: rowIdx, column: colIdx+incIdx});
        }, 10);
    }
}

 

Link to comment
Share on other sites

Hello @Sherzod

Yes, It works, after I made some all UnVisible columns to visible.

So I think I need to change this 

var widgetColIdx = 1; /*for example UniButtonWidget colIndex = 1*/

at run time, because the value of widgetColIdx will depend on visibility columns.

So How Can I Change it at runtime.

 

Regards

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...