Select in Data Grid
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Select in Data Grid
How to do that by selecting a row in the data grid then jump to that card using a button.
So i have one list with different titles and every title lead on different card, i select one title and jump that card with pressing button?
I put it wrong but I can't describe it any other way.
So i have one list with different titles and every title lead on different card, i select one title and jump that card with pressing button?
I put it wrong but I can't describe it any other way.
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Select in Data Grid
1. select a row in a datagrid.How to do that by selecting a row in the data grid then jump to that card using a button.
2. "jump to that card".
part 1 is easy-peasy, lemon-squeezy:
Code: Select all
on mouseDown
put the clickline into fld "fLineClicked"
end mouseDown
a) If you mean that you want to use a datagrid as a navigation menu, I think you are over-doing things a bit:
personally I'd just "go for" a scrolling list field . . .
BECAUSE when I click on my DG with that script above the data the line contains does NOT end up in the output.
- -
This screws up in a Datagrid:
Code: Select all
on mouseDown
put the selectedText of me into fld "fLineClickedx"
end mouseDown

- -
Code: Select all
on mouseDown
put the selectedText of me into XXX
go to card XXX
end mouseDown
Last edited by richmond62 on Sun Oct 04, 2020 9:44 am, edited 1 time in total.
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Select in Data Grid
Here's my stack with the listField.
- Attachments
-
- Navi - Gator.livecode.zip
- Here's the stack.
- (2.41 KiB) Downloaded 206 times
Re: Select in Data Grid
This is it, thank you.
Re: Select in Data Grid
Thank you for the senior members of the livecode. It is very helpful for the sample stack that you provide. 

Re: Select in Data Grid
How can i add in Scrolling List Field each new text on a new line with button? There is a field in which I type the text and copy it in the Scrolling List Field with buton.
I now use this code, but it always copies only one line and deletes the previous word.
I now use this code, but it always copies only one line and deletes the previous word.
Code: Select all
on mouseUp pMouseButton
set the text of field "scrollingList" to the text of field "titleField"
record the text in field "scrollingList"
end mouseUp
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Select in Data Grid
Well: you have to do a bit more than that:
1. You have to add a new line of text in your listField.
2. You have to add a new card to the stack with the same name as the line of text you have put in your listField.
Button: ADD NEW ITEM:
The ONLY PROBLEM is I cannot work out how to inject a script into a new card to set its title to its name.
- -
1. You have to add a new line of text in your listField.
2. You have to add a new card to the stack with the same name as the line of text you have put in your listField.
Button: ADD NEW ITEM:
Code: Select all
on mouseUp
ask "Text for new item: "
put it into KKK
put 1 into KOUNT
repeat until line KOUNT of field "SLF" is empty
add 1 to KOUNT
end repeat
put KKK into line KOUNT of field "SLF"
create card KKK
go first card
end mouseUp
- -
- Attachments
-
- Navi - Gator2.livecode.zip
- Here's the stack.
- (2.62 KiB) Downloaded 221 times
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Select in Data Grid
Why am I so good at saying I cannot work something out just before I do?
-
-
-
"OFF" to have Etwas dunkles Bier.

Code: Select all
on mouseUp
ask "Text for new item: "
put it into KKK
put 1 into KOUNT
repeat until line KOUNT of field "SLF" is empty
add 1 to KOUNT
end repeat
put KKK into line KOUNT of field "SLF"
create card KKK
set the script of card KKK to ((fld "s1" of card "HOME") && KKK & quote & cr & (fld "s2" of card "HOME"))
go first card
end mouseUp
"OFF" to have Etwas dunkles Bier.

- Attachments
-
- Navi - Gator3.livecode.zip
- Here's the stack.
- (2.84 KiB) Downloaded 223 times
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Select in Data Grid
BUT . . . just before I go, I would like to state that the ONLY way I am ever likely to use a dataGrid is
if someone cocks a gun at my head . . .
. . . I am sure they are "all very clever and useful in their way", but I'd far rather stick to
listFields and tableFields.
if someone cocks a gun at my head . . .
. . . I am sure they are "all very clever and useful in their way", but I'd far rather stick to
listFields and tableFields.
Re: Select in Data Grid
What Richmond really meant, even being held hostage by his own hand, is that new users often use dataGrids too soon.
DataGrids are compact, elegant and powerful tools, written by one of our most resourceful members. But they have their own API and are complex. They are attractive to those new users I mentioned because they seem to have everything one could ask for in a single package.
They do.
But they have a learning curve quite apart from LiveCode's own, and are often not nearly necessary to implement the functionality required. I am in no way trying to steer anyone away from learning about them. But I am advising that the more basic controls be examined first, since they are far simpler to use, and oftentimes do just what Richmond said, work just fine.
Craig
DataGrids are compact, elegant and powerful tools, written by one of our most resourceful members. But they have their own API and are complex. They are attractive to those new users I mentioned because they seem to have everything one could ask for in a single package.
They do.
But they have a learning curve quite apart from LiveCode's own, and are often not nearly necessary to implement the functionality required. I am in no way trying to steer anyone away from learning about them. But I am advising that the more basic controls be examined first, since they are far simpler to use, and oftentimes do just what Richmond said, work just fine.
Craig
Re: Select in Data Grid
The 3rd Navi - Gator is work perfectly great thanks for this.
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Select in Data Grid
Kein dunkles Bier, aber gut genug für mich.
Thinking about things, I think I'd modify the contents of field "s1" to this:
Code: Select all
on openCard
set the title of this stack to "
So that 'card fishface' is just called 'fishface' instead.

-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Select in Data Grid
From "somewhere else":
list field (SLF) would have to be in that card's cardScript, so, everytime one went to that card it would pop the name of the field
on that card into a line in the SLF.
-
The problem that I can see about this is that the code bunging the title of a field on a car into a line in a scrollingcould import the title from an existing field into the scrolling-list-field by jumping to that current card. So I'm not typing in an address, I'm importing an existing one.
list field (SLF) would have to be in that card's cardScript, so, everytime one went to that card it would pop the name of the field
on that card into a line in the SLF.
-
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Select in Data Grid
Actually that is pretty silly . . .
1. The listing in the inital SLF is of card names: if those are changed to the titles of textFields residing on those cards
the navigational capacity will be lost . . .
2. So: if you really think "that is the way to go" you might want to put the name of the textField into the second item of a more complex scrolling field.
- -
https://youtu.be/pr3zpqp3ypY
-
Well; there's one way to go.
HOWEVER . . . a tableField will NOT accept mouseDown signals in the same way as a SLF.
-
1. The listing in the inital SLF is of card names: if those are changed to the titles of textFields residing on those cards
the navigational capacity will be lost . . .
2. So: if you really think "that is the way to go" you might want to put the name of the textField into the second item of a more complex scrolling field.
- -
https://youtu.be/pr3zpqp3ypY
-
Well; there's one way to go.

HOWEVER . . . a tableField will NOT accept mouseDown signals in the same way as a SLF.
-
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Select in Data Grid
I think you are going to have a problem.
For example on my card "fishpie" I have a field called "How to cook Rotis", and that is all very jazzy, BUT if
our code is going to be in the cardScript to put the name of that field into item 2 [{Delimited lines] of the
card's line in the SLF on the first card of the stack HOW is it going to refer to the field without ALREADY knowing its name?