Data detail won't update on click

I was following this tutorial Displaying Record Details with the Data Detail Component and tried to achieve the same but in my case on click event won’t work and data is static with selected first item.

My code is bellow:

		<tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="sc_get_all_events.data.query_get_all_events" id="tableRepeat2">
			<tr>
				<td dmx-text="name" dmx-on:click="data_detail1.select(id)"></td>
				<td dmx-text="date_time"></td>
				<td dmx-text="created_by"></td>
				<td dmx-text="created_datetime"></td>
			</tr>
		</tbody>
	</table>
</div>
<div class="col" is="dmx-data-detail" id="data_detail1" dmx-bind:data="sc_get_all_events.data.query_get_all_events" key="id">
	<div class="row">
		<div class="col-12">
			<p>{{data_detail1.data.name}}</p>
		</div>
		<div class="col-12"></div>
		<div class="col-12"></div>
		<div class="col-12"></div>
	</div>
</div>

Can some one please guide me what I’m doing wrong?

Hello, do you see any errors or warnings in the browser console? Does your database query return the value you have selected as a key -> id?
Does it make any difference if you move the onclick event on the table row, instead of the td ?

My DB query was set to return all columns within a table “events.*”

And for me it was a surprise that in this case query won’t return ID column.
Lesson learned.

Thank you.

But you should either add all or select some of the columns. In your screenshot is see you added * but also selected some columns. Don’t mix both.

Also when you don’t add anything to the columns list on the right, all the columns are added as * is used.

1 Like

Thank you for detailed explanation.

I’m working through the same lesson. Shouldn’t the mouse pointer change to the mouse click hand?