Jump to content

Cant used keyboard to toggle checkbox column in TUniDBgrid.


Daryl McMurray

Recommended Posts

Not sure if I'm missing a property or something here... I have a TuniDBGrid with several boolean columns.  With the grid in edit mode, I can edit the text columns starting with the first, and tab to the next one which is automatically in edit mode... all is good... until I get to a checkbox column.  It gets selected, but there doesn't seem to be any way to toggle the checked value using the keyboard.  I expect space bar to work, but it does not. 

 

Only way to check the box seems to be to have to reach over and used the mouse to click on it. 

 

My application is almost purely data entry, row after row, and so this would be a big annoyance.  I've tried everything I can think of. 

 

Can not use a TUniCheckBox as a column editor, and it doesn't work in RowEditor Mode either  (in fact that is much worse as the tabOrder is all screwed up)

 

Thoughts? 

 

Using version 1.0.0.1407  professional paid.

 

A little more information... the "beforeedit" js event is not being fired on the checkbox column.   So it looks like the grid just never puts the cell into edit mode.

 

Edit-  Nope - tried this in the cellKeyDown...    

 

function cellkeydown(sender, td, cellIndex, record, tr, rowIndex, e, eOpts)
{
  // only fire on F4
  if (e.keyCode==115){
    ed=sender.getSelectionModel().getCurrentPosition(); 
    sender.editingPlugin.startEdit(ed.row, ed.column);
  } 
}
 
the startedit function returns true and puts the cell into edit mode for all columns except the check box column... for that, it returns false and does nothing.
Link to comment
Share on other sites

Yes, sorry - I am now on build 1424 - the problem is still there.  

 

I have developed a workaround however...

 
Attached to the grid... 
 
function cellkeydown(sender, td, cellIndex, record, tr, rowIndex, e, eOpts)
{
  if (e.keyCode==32){
    if (sender.getGridColumns()[cellIndex].checkColumn){
      td.firstElementChild.firstElementChild.firstElementChild.onclick();
    }
  } 
}
 
I will use this for now, but I believe it should be built in as not having keyboard support for checkbox columns really messes up data entry flow.  
 
I have also noticed  that the grid does not adhere to the TDataSource.AutoEdit Property.    
I usually make data entry fields require an explicit dataset.edit before allowing changes to be made so that data doesn't get changed accidentally by users.
 
Lastly, I'm sorry that my first form comment is to deal with issues - So, I would also like to say THANK YOU - for all of your hard work on this framework.  For a Delphi Developer, it really is an amazing tool and so powerful.  I can see that you are constantly improving it, and your attention and response to this form, your customers, and even only potential customers, is outstanding!
Link to comment
Share on other sites

I've discovered another minor issue...  the TUniDBDateTimePicker component does not initialize to readonly when the dataset.autoedit property is set to false.  

 

once you edit and then cancel or post the recordset, then it behaves properly, but on creation in the browser, it always starts in editing mode.  

 

I have fixed this on my system by adding the line

 

SetJSReadOnly(InternalReadOnly);

 

to the end of the TUniCustomDBDateTimePicker.LoadCompleted procedure. 

 

I'm not sure if that is where you would correct the problem but it seems to work now.

 

Thank you.

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