| Subject |
Re: Changing value of speedTip |
| From |
Mervyn Bick <invalid@invalid.invalid> |
| Date |
Thu, 9 Dec 2021 21:53:51 +0200 |
| Newsgroups |
dbase.getting-started |
On 2021/12/09 19:55, Milind Nighojkar wrote:
> Hi Ken,
>
> I wrote code as below for a grid. Not able to see the change in speedtip based on the field value
>
> ****************
> function rowset_onNavigate(type, nRows)
> if this.fields["emp_active"].value = false
> this.CanEdit := false
> else
> this.fields["name"].speedtip = 'Changed Speedtip'
> endif
> return true
> ****************
A field does not have a built-in speedtip property. See speedtip in the
help file for a list of objects which do have a speedtip property.
this.fields["name"].speedtip = 'Changed Speedtip' is creating a user
defined property for the field but dBASE doesn't know what to do with it.
A grid is an object that has a speedtip property and if the mouse is
over any portion of a record displayed in the grid for more than one
second the speedtip will display.
No event handler associated with a query or a rowset understands the
concept "form" so you can't use
form.grid1.speedtip = 'Changed Speedtip'
Try the following
****************
function rowset_onNavigate(type, nRows)
if this.fields["emp_active"].value = false
this.CanEdit := false
else
this.parent.parent.grid1.speedtip = 'Changed Speedtip'
endif
return true
****************
In the the onNavigate event handler
this is the rowset
this.parent is the query
this.parent.parent is the form
Mervyn.
|
|