Jump to content

questions about unistringgrid


jahlxx

Recommended Posts

Hi,

 

- how to direct input data in a unistringgrid? the user can't direct type data in the grid. must type <RETURN> before

 

For now can you try this quick solution?!
But there may be a problem, if a user directs the input data very quickly...

 

UniStringGrid1 -> ClientEvents -> ExtEvents -> function keydown:

function keydown(sender, key, shift, eOpts)
{
    var btn=sender.button;
    if (btn == 36 || btn == 37 || btn == 38 || btn == 39) {
        return false;
    };
    
    var me=this.normalGrid;
    if (me && me.editingPlugin) {
        if (!me.editingPlugin.editing) {
            me.editingPlugin.startEditByPosition(me.getSelectionModel().getCurrentPosition());
            me.editingPlugin.getActiveEditor().field.selectText();        
        }
    }
}

Best regards.

Link to comment
Share on other sites

  • 1 year later...

Can you try this code ?:

function keydown(e, t, eOpts) 
{
    var me = this.ownerGrid,
        currPos = me.getSelectionModel().getCurrentPosition();

    if (!currPos.view.isLockedView) {

        var btn = e.keyCode;

        if (btn == 37 || btn == 38 || btn == 39 || btn == 40) {
            return false;
        };

        if (me && me.editingPlugin) {
            if (!me.editingPlugin.editing) {
                //me.editingPlugin.startEditByPosition(me.getSelectionModel().getCurrentPosition());
                me.editingPlugin.startEditByPosition({
                    row: currPos.row,
                    column: currPos.column + me.fxCols
                });
                me.editingPlugin.getActiveEditor().field.selectText();
            }
        }
    }
}

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...