pluck() on property derived from leftJoin
pluck() on property derived from leftJoin
ekkeroth
Posts: 19Questions: 6Answers: 0
does anybody know why
var Lat = table.rows( indexes ).data().pluck( 'Lat' );
works, but
var Lat = table.rows( indexes ).data().pluck( 'fi_branch.lat' );
does not?
The result is undefinded
.
Could it be that pluck() has a problem with joined tables?
The corresponding line from the php files would be:
Field::inst( 'Lat' ),
and
Field::inst( 'fi_branch.lat' ),
This discussion has been closed.
Replies
Is your data returned as an array or as objects?
If an array then you may need to change your pluck to reference the column number, for example:
var Lat = table.rows( indexes ).data().pluck( 3 );
Assuming
Lat
is column 3.Kevin
It is unlikely you have a property name with a
.
in it, andpluck
only operates on a single level. It will not go down and get nested data likecolumns.data
andfields.name
will.Allan
Thank you.
Referencing the column number by number did not work either.
Hence, will look more into columns.data then.