insertrow - set focus - default date

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

fronsky
Ebase User
Posts: 86
Joined: Thu Mar 08, 2018 2:52 pm

insertrow - set focus - default date

#1

Postby fronsky » Wed Aug 08, 2018 8:18 am

I want to replace the standard add row button to get more control on the button. Also I want to use today's date as default date in first column.

1.) When I use insertrow, the currentrow/first field doesn't get focus as when using Add row. How can I achieve this?

2.) When I use a script to have the first field (datetime field) filled with today's date (new Date()) I get a formexception error 'Unable to set value for field xxxx, object type org.mozilla.javascript.NativeDate is not compatible with field type DATE'. I hope somebody can help me with this.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

Re: insertrow - set focus - default date

#2

Postby Jon » Wed Aug 08, 2018 11:45 am

When I use insertrow, the currentrow/first field doesn't get focus as when using Add row. How can I achieve this?

Code: Select all

tables.tabname.colname.columnControl.requestFocus();
or just..
controls.columncontrolname.requestFocus();
When I use a script to have the first field (datetime field) filled with today's date (new Date()) I get a formexception
Works fine for me with both date and datetime types..

Code: Select all

tables.tabname.insertRow();
tables.tabname.colname.value = new Date();
0 x

fronsky
Ebase User
Posts: 86
Joined: Thu Mar 08, 2018 2:52 pm

Re: insertrow - set focus - default date

#3

Postby fronsky » Thu Aug 09, 2018 10:25 am

Great. All works. Thanks.
0 x


Who is online

Users browsing this forum: Google [Bot] and 9 guests