Jump to content

questions about unistringgrid


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

 

- can I define maks for every column?

 

- how can I control the change of the value of a cell?

 

thanks.

Link to post
Share on other sites

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