Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3800

Field->options(), primary key and alias

$
0
0

Hello,
Using Field with a column, which is part of a compound primary key, I need to use an alias, e.g.:
Field::inst( 'a', 'b.c' )
Then, on client side I have to use

fields: [
  {
    data: 'b.c',
    name: 'a'
  }
]

( Using just name: 'b.c' I get an error: "Primary key element is not available in data set." submitting the form)

Adding the Field->options(), the options in the server response JSON are included as
options: {b.c: [{label: ..., value: ...}, {label: ..., value: ...},…]} (no dotted object notation, 'b.c' is the attribute name...)

Unfortunately, the client side is awaiting the options according to name, i.e. as
options: {a: ...}

So, opening the editor form, the select is empty...

Any idea?


Viewing all articles
Browse latest Browse all 3800

Trending Articles