enso-ui / tables

Tables
MIT License
11 stars 10 forks source link

CoreTable ajax method undefined dtRowId #4

Closed thedoan closed 4 years ago

thedoan commented 4 years ago

This is a **bug.

Prerequisites

i use enso-ui tables 1.1.5

Description

When i click row action button destroy, nothing happen When i debug with console.log, i see that path undefined ex:/admin/posts/undefined

Steps to Reproduce

I found why and where it happend. It in CoreTable ajax's method I think that instead of row['dtRowId'], you use row[this.template.dtRowId] make it undefined because this.template.dtRowId is undefined

Expected behavior

/admin/posts/number

Actual behavior

/admin/posts/undefined

aocneanu commented 4 years ago

Hi,

I guess the tables docs might have been left behind. We wrote in the changelog about this.

Long story short, if you use Tables outside Enso you can easily configure the default "dtRowId" => "dtRowId" key in the tables config instead of the new default "id".

And you can override this setting per template.

Or refactor your tables to drop the "dtRowId" alias in favour of id.

A contribution to the docs in this sense would be appreciated ;)

thedoan commented 4 years ago

thank mr. aocneanu