This.fnGetSelectedIndexes() is not a function

This.fnGetSelectedIndexes() is not a function

samevedzisamevedzi Posts: 30Questions: 5Answers: 0
edited December 2022 in Editor

Hi,

I have used remove(this.fnGetSelectedIndexes()) in my code below but I'm getting an this.fnGetSelectedIndexes is not a function error.

                {
                    extend: "remove",
                    editor: Editor_Requisition,
                    action: function (e, dt, node, config) {
                        var status = 'Added';
                        var can_delete = true;
                        var selectedIDs;

                        //Go through each selected record and see if Status is different from 'Added'
                        Datatable_Feedback_Header_Attached.rows({ selected: true }).data().each(function (value, index) {
                            if (value.Requisition.Status != status) {
                                can_delete = false;
                            }
                        });

                        if (can_delete) {
                            Editor_Requisition
                                .message("Are you sure you want to delete the selected items?")                                
                                .title("Delete")
                                .buttons("Ok")
                                .remove(this.fnGetSelectedIndexes());
                        }
                        else {
                            alert('You can only delete Requisitions whose status is "Added"');
                        }                        
                    }
                }

An assistance or reference will be much appreciated.

Thanks in advance.

---Stephen

This question has an accepted answers - jump to answer

Answers

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

    You probably want:

    Datatable_Feedback_Header_Attached.rows({selected: true}).indexes();
    

    See rows().indexes().

    `fnGetSelectedIndexes()' comes from TableTools, which was retired in 2014 :).

    Allan

  • samevedzisamevedzi Posts: 30Questions: 5Answers: 0

    Hi Allan,

    Thanks so much for helping me out once again.

    Regards,
    ---Stephen

Sign In or Register to comment.