Hi
I am working on custom column behaviours in a grid.
What I want to do (to start with) is to programmatically focus on a specific column and in effect "double click" to start editing
I am using all forms of the focus on command but is not working even just to focus on the grid itself
for example
focus on group "grid1" of this card
focus on "field "date" of group "grid1" of this card
the first one gives no error but does nothing. The second one says there is no such object
specifically button "focus": execution error at line 3 (Chunk: no such object), char 1
KIndest Regards Lagi
SOLVED:setting focus and editing field programmatically
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 365
- Joined: Mon Jun 10, 2013 1:32 pm
SOLVED:setting focus and editing field programmatically
Last edited by Lagi Pittas on Tue Jan 20, 2015 12:56 pm, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: setting focus and editing field programmatically
Hi Lagi Pittas,
You have an errant quote in front of field
Bad
focus on "field "date" of group "grid1" of this card
Good
focus on field "date" of group "grid1" of this card
Not clear on the other stuff you would like.
Simon
Edit; OK so it is a datagrid. Check out EditFieldText in the Data Grid API.
You have an errant quote in front of field
Bad
focus on "field "date" of group "grid1" of this card
Good
focus on field "date" of group "grid1" of this card
Not clear on the other stuff you would like.
Simon
Edit; OK so it is a datagrid. Check out EditFieldText in the Data Grid API.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 365
- Joined: Mon Jun 10, 2013 1:32 pm
Re: setting focus and editing field programmatically
Hi Simon
Thanks for the reply
The second line is like you said, I just mistyped in my post Ibshoukd have cut and pasted
Both lines give no errors when I press apply
The second only gives the error when executing the line.
I was hoping if I could get the focus workingb then I could at least send a double click message to star editing automatically
Lagi
Thanks for the reply
The second line is like you said, I just mistyped in my post Ibshoukd have cut and pasted
Both lines give no errors when I press apply
The second only gives the error when executing the line.
I was hoping if I could get the focus workingb then I could at least send a double click message to star editing automatically
Lagi
-
- VIP Livecode Opensource Backer
- Posts: 365
- Joined: Mon Jun 10, 2013 1:32 pm
SOLVED: setting focus and editing field programmatically
HI
I suppose it's RTFM (Read The Fine Manual) time - seems the Datagrid being a group can't get focus
so we have to use :
set the dgFocus of group "grid1" to true|false
Now I have been trying to do the next part of opening up the cell for editing WITHOUT needing to double click.
Infact what I wanted to do was open the first cell for editing when the grid gets focus but I have settled for the easier route.
I changed the MouseDoubleUp to mouseup for each column behavior and it does what I need - but it has been a real pain for something so simple
Regards Lagi
I suppose it's RTFM (Read The Fine Manual) time - seems the Datagrid being a group can't get focus
so we have to use :
set the dgFocus of group "grid1" to true|false
Now I have been trying to do the next part of opening up the cell for editing WITHOUT needing to double click.
Infact what I wanted to do was open the first cell for editing when the grid gets focus but I have settled for the easier route.
I changed the MouseDoubleUp to mouseup for each column behavior and it does what I need - but it has been a real pain for something so simple
Regards Lagi