JavaScript Code
if ($language == 'english') {
var displayvalue = "";
if (data[i].report_name.length >= 20) {
displayvalue = data[i].report_name.substr(0, 20) + "...";
} else {
displayvalue = data[i].report_name;
}
subMDesign += '<a href="" ng-click="getIndividualGraph(' + data[i].report_id + ',' + data[i].report_type + ')" ondragstart="event.dataTransfer.setData(text, drag.action?reportId=' + data[i].report_id + '&reportType=' + data[i].report_type + '_' + data[i].report_id + '_' + data[i].report_type + '_22)"><span class="iconsweet">r</span><span class="tooltips" title="' + data[i].report_description + '" unselectable="on">' + displayvalue + '</span></a>';
} else {
var displayvalue = "";
if (data[i].report_name.length >= 20) {
displayvalue = data[i].report_name_ar.substr(0, 20) + "...";
} else {
displayvalue = data[i].report_name_ar;
}
subMDesign += '<a href="" ng-click="getIndividualGraph(' + data[i].report_id + ',' + data[i].report_type + ')" ondragstart="event.dataTransfer.setData(text, drag.action?reportId=' + data[i].report_id + '&reportType=' + data[i].report_type + '_' + data[i].report_id + '_' + data[i].report_type + '_22)"><span class="iconsweet">r</span><span class="tooltips" title="' + data[i].report_description + '" unselectable="on">' + displayvalue + '</span></a>';
}
}
var temp = $compile(subMDesign)($scope);
$("#reportUl" + $catid).html(temp);
I have a dynamic addition of subMDesign
to a div
in the last line. Upon examination in the console, subMDesign
is represented as displayed below:
https://i.sstatic.net/TEzN6.png
During dragging, an error appears in the console like so:
ReferenceError: invalid assignment left-hand side event.dataTransfer.setData(text, drag.action?reportId=93&reportType=6_93_6_22)
The arrow points to the segment where there seems to be an issue with reportId=93. I am seeking assistance to resolve this problem.