Skip to content
This repository was archived by the owner on Jan 4, 2020. It is now read-only.
This repository was archived by the owner on Jan 4, 2020. It is now read-only.

Unable to get data-id value #36

@manusharma1

Description

@manusharma1

Hi,

I am using bootstrap confirmation in Meteor.JS App

Here is my code:

HTML

There is a loop which fetch the data from DB

            {{#each FetchRecords}}
            <tr>
                <td><a href="#" data-id="1" class="edit">{{name}}</a></td>
                <td>{{order_id}}</td>
                <td><a class="btn confirmation" id="delete" data-toggle="confirmation" data-id="{{_id}}" data-placement="right" data-original-title="" title="">Delete</a></td>
            </tr>
            {{/each}}

JS:

      $('[data-toggle="confirmation"]').confirmation({onConfirm: function(){
    console.log($(this).data("id"));

      }});

I am unable to get the data-id value, its saying undefined. Could you please tell me how to fetch the data-id value when the confirm button is clicked.

Thanks and Best Regards,
Manu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions