Browsed by
Month: October 2018

How to initialize a block loader Magento 2

How to initialize a block loader Magento 2

Did you want to add loader into **templates/cart/totals.phtml** These some ways to add loader spinner into block or page. 1 Use: <div data-bind=”blockLoader: isLoadding”> /** Block Content HTML */ </div>, with this option you should add **isLoadding : ko.observable(false)** into your Component Example: Block XML Define <block class=”Magento\Framework\View\Element\Template” name=”block-name” template=”Namespace_ModuleName::templates.phtml”> <arguments> <argument name=”jsLayout” xsi:type=”array”> <item name=”components” xsi:type=”array”> <item name=”scope_name” xsi:type=”array”> <item name=”component” xsi:type=”string”>Namespace_ModuleName/js/componentjsfile</item> </item> </item> </argument> </arguments> </block>   Block templates.phtml CODE <div id=”abc-def” data-bind=”scope: ‘scope_name'”> <div class=”product-wizard-selections” data-bind=”blockLoader: isLoading”>…

Read More Read More

Follow by Email
Facebook
Facebook
LinkedIn