If you are using require([“jquery”, “domReady!”], function($){} function or jQuery(window).load() function, Using this code, mostly your custom javascript code executes before the knockout element render.
Knockout js has afterRender event.
See below simple demo for afterRender function.
1 2 3 |
<div class="ko-concetp"> <div data-bind="afterRender: loadJsCustomAfterKoRender"></div> </div> |
Here, we have to define afterRender in the data-bind syntax for use in a knockout as shown above.
loadJsCustomAfterKoRender is the function which we need to call after knockout rendered completely.
Now, create a function loadJsCustomAfterKoRender in the js file as below:
1 2 3 |
loadJsCustomAfterKoRender: function(){ // write your custom script logic here } |
The above logic will solve the problem.
CONTACT US to get Magento programming solutions by hiring a certified Magento expert.
[crayon-63d3eabfd9abf127860382/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.