Data Grid Concatenate Info from Columns in Table
Posted: Sun Oct 01, 2017 6:36 pm
Hi,
I have been learning and working with LiveCode for a while now, but now I've started learning datagrids and am having trouble. I am trying to concatenate text from two columns in a datagrid table, not a form, and place it automatically in a third column. I have columns "NameFirst", "NameLast", and "NameCombined".
I've used this code elsewhere with a button. This works for renaming the buttons. But, I'm looking for the table to auto fill the text fields in the 3rd column without clicking anything.
I know I can do the data combining/concatenation prior to placing it in the datagrid, and I might if it keeps driving me crazy. But, I'm trying to understand so I'm still plugging away at getting it to work.
I've tried various versions of the following in the fillInData pData edit area of the data grid. I placed a text field inside column 3 and called the field "NameCombined".
I've downloaded the datagrid .pdf and have been reading it and worked some of the datagrid lessons on this topic, but the lessons seem to focus on how to do it for forms. I'm wondering as well if it is working but I'm not able to see it because I've forgotten something to make it render in the table. I do have DataGridHelper and used that for my button tests. Thanks for any thoughts or help,
I have been learning and working with LiveCode for a while now, but now I've started learning datagrids and am having trouble. I am trying to concatenate text from two columns in a datagrid table, not a form, and place it automatically in a third column. I have columns "NameFirst", "NameLast", and "NameCombined".
I've used this code elsewhere with a button. This works for renaming the buttons. But, I'm looking for the table to auto fill the text fields in the 3rd column without clicking anything.
Code: Select all
put the dgHilitedLines of group "DataGrid 1" into theLine
put the dgDataOfLine[theLine] of group "DataGrid 1" into theDataA
put theDataA["NameFirst"] && theDataA["NameLast"] into tNameCombinedLabel
set the label of target to tNameCombinedLabel
I've tried various versions of the following in the fillInData pData edit area of the data grid. I placed a text field inside column 3 and called the field "NameCombined".
Code: Select all
set the text of field "NameCombined" of me to pData["NameFirst"] && pData["NameLast"]