Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

GOOD theme BlockUI util

Since I lost one hour on it :( It works fine on DIVs, but not on other elements (e.g. SELECT or INPUT). Maybe update the docs by saying "where" it works, because it took me quite a while to debug it - it would correctly let me create the instance, only to be empty with no block/release methods.

Also, maybe you can add into the doc that a simple example


const blockUIInstances = {};

function blockIt(id) { if (blockUIInstances[id]) { return; // If it already exists, do nothing } const targetElement = document.querySelector("#"+id); if (targetElement) { blockUIInstances[id] = new KTBlockUI(targetElement); console.log('KTBlockUI instance:', blockUIInstances[id]); if (typeof blockUIInstances[id].block === 'function') { blockUIInstances[id].block(); // Activate the spinner } else { console.error(block() method not found on KTBlockUI instance for target: ${id}); } } else { console.error(Element with ID '${id}' not found in the DOM.); }
return }

function releaseIt(id) { if (blockUIInstances[id]) { console.log('deleting '+id) blockUIInstances[id].release(); // Deactivate the spinner delete blockUIInstances[id]; // Remove the instance } return }


so that you can have dynamic ones according to the id, without the need to create static ones

Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Your suggestions for improving the documentation to specify the working conditions of the implementation and to include a dynamic example are quite valuable. Lows Adventures 2



Hi,

Yes, you will need to wrap input elements with container div and apply the blockUI on the div element.

Sure, we will update the docs.

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(