Pluck returns blank values

Pluck returns blank values

nicoledramirez@hotmail.comnicoledramirez@hotmail.com Posts: 60Questions: 14Answers: 2
edited June 2017 in DataTables 1.10

Hello,
Have an issue with the pluck() function. it seems to be returning blank values. Any suggestion.

{
                       extend: "edit", className: 'btnSelect2', editor: editor, text: "Delete Leave Request", formTitle: "Delete Leave Requests",
                       formMessage: function (e, dt) {
                           var rows = dt.rows(e.modifier()).data().pluck('cdi_calendar_changes.date1');
                           return 'Are you sure you want to delete the entries for the ' +
                           'following record(s)? <ul><li>' + rows.join('</li><li>') + '</li></ul>';
                       }

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    You can't use pluck on nested data (cdi_calendar_changes.date1).

    You'd need to do something like .pluck( 'cdi_calendar_changes' ).pluck( 'date1' ).

    To be honest I don't recall having tried that before, but I don't see why it wouldn't work...

    Allan

  • nicoledramirez@hotmail.comnicoledramirez@hotmail.com Posts: 60Questions: 14Answers: 2

    Hi Allan,

    Still comes up blank. :(

  • nicoledramirez@hotmail.comnicoledramirez@hotmail.com Posts: 60Questions: 14Answers: 2

    Opps. Disregard my previous post. Lack of sleep is frying my brain.

    Your suggestion worked! Thank you! :)

This discussion has been closed.