Created
January 15, 2022 11:08
-
-
Save phongbv/3fca32366d862c5b38bca0a74b279f8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var trackedEvents = ["CLICK", "KEYPRESS", "SELECT", "CHANGE"]; | |
function RegisterEvent(){ | |
$("a[role='tab']").click(CustomNavBarClick) | |
$("a[data-toggle='tab']").click(CustomTabClick) | |
} | |
function handleEvent(){ | |
console.log("Event type: " + event.type) | |
console.log("Event " + JSON.stringify($(event.target))) | |
} | |
function elementClicked() { | |
window.ASPx = window["ASPx"]; | |
ReregisterDevExpressEvent(); | |
var target = event.target; | |
var tagName = target.tagName; | |
// Thẻ a đang được click | |
if( tagName == 'A') | |
{ | |
// Đang click navigation bar | |
if($(target).attr("role") == 'tab'){ | |
console.log('Navigation bar '+ target.innerText +' clicked') | |
}// Đang click các tab | |
else if($(target).attr('data-toggle') == 'tab') | |
{ | |
console.log('Tab '+ target.innerText +' clicked') | |
} | |
} | |
else if( tagName == 'INPUT' && target.type == 'button') | |
{ | |
console.log('Button '+ target.value +' clicked') | |
} | |
else if( tagName == 'SPAN' && target.classList.contains('dx-vam') || tagName == 'IMG' && target.classList.contains('dx-vam'))// Menu Button của Dev Express | |
{ | |
console.log('Menu button '+ target.parentElement.innerText +' clicked, control name ' + target.parentNode.id); | |
} | |
else { | |
console.log(target.tagName); | |
} | |
} | |
function keyPress(){ | |
} | |
document.body.addEventListener("click", elementClicked); | |
document.body.addEventListener("keypress", keyPress); | |
function ReregisterDevExpressEvent(){ | |
window["ASPx"].EValueChanged = function(name) { | |
console.log("Control "+ name +" value changed") | |
var edit = window["ASPx"].GetControlCollection().Get(name); | |
if(edit != null) | |
edit.OnValueChanged(); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment