After .onRowSelect, the record's id is 'undefined'

@karenmpiekarski
You get this CONSOLE-LOG, when clicking onto on of the table-rows…

I gave you already the code for this action, take a look 2-3 of my post ago.

Here the working CODE one more time (for the onRow-Select-Action)…

var myDATA 

export function table1_rowSelect(event) {
    console.log(event)
    $w('#BTNeditItem').enable()
    myDATA=event
}

export function BTNeditItem_click(event) {
    console.log("myDATA = ", myDATA.rowData)
    console.log("-------------------------")
    console.log("myDATA = ", myDATA.rowData._id)
    console.log("Salutation = ", myDATA.rowData.anrede)
    console.log("First-Name = ", myDATA.rowData.vorname)
    console.log("Last-Name = ", myDATA.rowData.name)
    console.log("Status = ", myDATA.rowData.status)
 //------------------------------------------------
    $w('#input1').value = myDATA.rowData.anrede
    $w('#input2').value = myDATA.rowData.vorname
    $w('#input3').value = myDATA.rowData.name
    $w('#input4').value = myDATA.rowData.status
 //------------------------------------------------
    $w('#columnStrip1').expand(), $w('#columnStrip1').show('fade')
}

You have 2-click-functions: 1) table1_rowSelect 2) BTNeditItem_click

  1. On first click → onto one of the many “table-rows” you get the console-log of the “click-event” (the big console-message on the beginning of this post).
    There you can get all the neccassary data of the event.
    Just take a closer look on it. You can recreate this console-log by your own, just run the example by yourself (while the console-window of google-chrome is opened —> F-12+CONSOLE).

in the first function a VARIABLE gets it’s VALUE after the first click was maden…

myDATA=event

The VARIABLE (“myDATA”) itself already was created right the beginning of the CODE.

Now (after the first click) “myDATA” holds the —> “event”-VALUE, a big bunch of data, which you can see in the console-log-pic.

  1. On second click the data of -->“myDATA”-variable is used to get all the saved row-data in this variable & pull these data into the shown INPUTS.
$w('#input1').value = myDATA.rowData.anrede
$w('#input2').value = myDATA.rowData.vorname
$w('#input3').value = myDATA.rowData.name
$w('#input4').value = myDATA.rowData.status


“anrede” —> “Frau”
“vorname” —> “Angela”
“name” —> “Merkel”
“status” —> “Inaktiv”

You can also open much more columns in this example, when you go to the Settings…

Which are your oppertunities/possibilities you will find here…

https://www.media-junkie.com/databases

There you will find the completed “Team”-DATABASE with all it’s data-fields.

To show more fields, just type in more existing column-data…

  1. nationalitat

  2. ausbildung

  3. verfugbarkeit

  4. and so on…
    Put these data into the INPUTS —> DropDown-Settings (in the middle).

  5. sprache & bundesland are special data-fields —> selection-tags.
    These ones you put into —> Check-Box-Settings (right-handed).

With these simple steps you will expand the given example.
Try it out.

BTW: You will also find some STARTING-CODE, which was maden in the very beginning of this project.

Read all the given stuff (it is really a lot of information given in this example).
Just navigate trough all the added, posts and databases.
Start with the ORIGINAL-POST and you will learn a lot.

@russian-dima , Sorry it took so long to get back with you. But, I wanted to let you know I changed my code to simulate yours…and so far, it’s good. Thank you for your help! I really appreciate it.

I need to start taking breaks. I get so frustrated and end up wasting hours trying different stuff, and I always end up making things worse than they were to begin with. Hope you have a good rest of the week…Take care and THANK YOU!

@karenmpiekarski Frustration is an essential part of coding :wink:.
And taking some break → is a good idea! After a little RESET, the brain starts working again better. I often do it the same way. :grin: