IndexTable onClick event

Maya531
New Member
1 0 0

Hi all, 

I'm new to React, so maybe my question won't make sense, but a point in right direction would be appreciated. 

I am trying to develop a simple embedded app, using IndexTable to display orders. In its help page, index table has this bullet: "Have items that perform an action when clicked. The action should navigate to the resource’s details page or otherwise provide more detail about the item.". That's exactly what I'd like to do, navigate to my order details page (with specific app related info), but can't get it to work. I tried using onClick, and onAction events in rowMarkup, but it's as if the interface doesn't detect the click.

This is the part of the code: 

const rowMarkup = orders.map((order, index) => (

<IndexTable.Row

id={order.id}

key={order.id}

selected={selectedResources.includes(order.id)}

position={index}

onClick={() => {

store.set('order', order);

redirectToOrder();

}}

>

 

What am I doing wrong?

 

0 Likes