-1

How to get data attribute value on file select event.

Note: Here i am trying to resolve current html to get jQuery object

$("#gridAttachment").find("input.fileUpload").each(function (index) {
       $(this).kendoUpload({ select: onAttachmentSelect });    
});

function onAttachmentSelect(e) {
       //debugger;
       var id = $('thisObj').data('id');
       //Some other Data Attribute Value

       //After validation jQuery AJAX Upload
};
Thulasiram
  • 8,432
  • 8
  • 46
  • 54

1 Answers1

0
function onAttachmentSelect(e) {
    //debugger;
    var fileUploadData = $(e.sender.element[0]).data();
    var id = fileUploadData.data('id');

    //jQuery AJAX Upload
};
Thulasiram
  • 8,432
  • 8
  • 46
  • 54
  • Or just `var id = $(e.sender.element[0]).data('id');` in any case this has been asked and answered on lots of previous occasions. – Rory McCrossan Jan 02 '20 at 11:47