500foods / tms-web-core-templatedemo Goto Github PK
View Code? Open in Web Editor NEWAn example of using TMS WEB Core with the AdminLTE 4 template as a front-end to a TMS XData REST API server.
License: The Unlicense
An example of using TMS WEB Core with the AdminLTE 4 template as a front-end to a TMS XData REST API server.
License: The Unlicense
At the moment, when switching Forms or SubForms, the DOMContentLoaded event is fired to try and get the AdminLTE JS to attach itself to whatever new components are on the page. The downside to this is that it wasn't designed for this. As a result, it re-attaches itself to any elements it finds, including those that it was already attached to previously.
As this attachment mechanism - addEventListener - uses anonymous functions rather than named functions, there isn't really any good way to remove the event handlers short of cloning the node in place. However, doing so removes other event handlers, including our own.
The resolution, for now, is to alter their JS code to add a class to the objects they've attached themselves to (the LTE class) and then only add new event listeners if that class is not present. Hack-ish, certainly. But it works. So we end up with an adminlte-custom.js that we use instead. A new function is inserted, and then the existing functions are replaced with references to this new function just by doing search and replace. Another approach would be to override the addEventListener function itself, but that's not very fun and besides, we only want these specific functions overridden.
/* CUSTOMIZATION
**
** Calling the DomLoaded event repeatedly to "apply" this JS to whatever has changed in the page
** results in multiple anonymous addEventListener instances and thus breaks the functionality.
** To get around this, an addCUSTOMEventListener function is used, with a search/replace to find
** the occurences of the original addEventListener calls. In this custom version, we just check
** if there is an LTE class. If it does, we skip the event. If it doesn't, we add the class
** and then issue the normal addEventListener call.
**
** search: btn.addEventListener(
** replace: window.addCUSTOMEventListener(btn,
**
** search: selSidebar.addEventListener(
** replace: window.addCUSTOMEventListener(selSidebar,
**
** search: window.addCUSTOMEventListener(targetContentWrapper,
** replace: window.addCUSTOMEventListener(targetContentWrapper,
*/
window.addCUSTOMEventListener = function(element,a,b,c) {
if (element.classList.contains('LTE')) {
// console.log(element+'aEV orverride: blocked');
} else {
// console.log(element+'aEV orverride: added');
element.classList.add('LTE');
element.addEventListener(a,b,c);
}
};
Originally posted by lexidev March 5, 2023
Hi!
I try to compile this program but I get the following error:
Error reading LoginForm.CSSLibrary: Property CSSLibrary does not exist...
Where is the problem?
WEB Core 2.0.5.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.