eLabSDK
Classes
| Name | Description |
|---|---|
| eLabSDK |
Functions
| Name | Description |
|---|---|
| ready(fn) | Register a callback to execute when the browser DOM is fully loaded and ready. |
This is a wrapper around jQuery's $(document).ready() that ensures your SDK code executes
only after the DOM has finished loading. Use this for all SDK initialization code, including
adding buttons, modifying page elements, registering event listeners, or performing any
operations that require the DOM to be available. This is the recommended entry point for
all SDK customizations.
eLabSDK
Kind: global class
new eLabSDK()
This is the description for my class.
ElabSDK
ready(fn)
Register a callback to execute when the browser DOM is fully loaded and ready.
This is a wrapper around jQuery's $(document).ready() that ensures your SDK code executes
only after the DOM has finished loading. Use this for all SDK initialization code, including
adding buttons, modifying page elements, registering event listeners, or performing any
operations that require the DOM to be available. This is the recommended entry point for
all SDK customizations.
Kind: global function
| Param | Type | Description |
|---|---|---|
| fn | function | The callback function to execute when the DOM is ready |
Example
// Add a custom button to the page
eLabSDK.ready(function(){
var button = new eLabSDK.GUI.Button({
label: 'My Custom Button',
action: function () {
alert('Button clicked!');
}
});
var page = new eLabSDK.Page();
page.addButton(button);
});
Example
// Initialize multiple SDK features
eLabSDK.ready(function(){
// Add custom button
var button = new eLabSDK.GUI.Button({
label: 'Export Data',
action: function () {
exportCurrentPageData();
}
});
// Modify page elements
document.getElementById('header').style.backgroundColor = '#4CAF50';
// Register event listeners
$('#sampleTable').on('click', 'tr', function() {
console.log('Sample row clicked');
});
});
Example
// Load user-specific customizations
eLabSDK.ready(function(){
var user = new eLabSDK.User();
var userName = user.getUserFullname();
console.log('Welcome, ' + userName);
// Load custom preferences
loadUserCustomizations(userName);
});
© 2023 eLabNext
Updated about 2 hours ago