Unknown parameter for md02_title.name in row 0
Unknown parameter for md02_title.name in row 0
In the following situation I get constantly the message that md02_title.name is an unknown parameter for row 0.
md02_usr: title_id = [1|2]
md02_title: id=1 -> name='Mw.', id=2 -> name='Dhr.'
Parts of js:
- "fields": [{label: "Titel", name: "md02_usr.title_id", type: "selec"t}]
- $('#modUsr').DataTable ({ columns [{ (data: "md02_title.name"}] })
Parts of PHP:
- Field::inst( 'md02_usr.title_id' )->options('md02_title', 'md02_title.id', 'md02_title.name'),
- ->leftJoin( 'md02_title', 'md02_title.id', '=', 'md02_usr.title_id' )
I have searched for this error some hours and I have changed a lot, but as far as I know the above is OK. Row 0 contains the valus 1 or 2, that's for sure.
Any idea what I oversee?
regards, Niek.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi Niek,
Could you possible show me the full PHP you are using and also a debug trace for your table?
Thanks,
Allan
Hi Allen,
You can find the debug trace in : usiwex.
The complete contents of my PHP-function is:
Regards, Niek.
Thanks. If you have a look at the JSON data being returned by the server you will see that indeed
md02_title.name
is not defined in the data. In fact there is nomd02_title
object at all.The reason for this is that there are no fields that obtain that data from the joined table (the options for
md02_usr.title_id
get it, but that isn't a field - just options).So you need to add:
to your fields. You may also want to add
->set( false )
to it just to protect it from being written to.Allan
Hi iAllen,
Thanks. This worked immediately (as you already knew of course :-) )
Regards, Niek