Questions tagged [knockoutjs]

Denotes questions related to Knockout use in Magento2

Filter by
Sorted by
Tagged with
11
votes
1answer
1k views

How can I trigger code to run after knockoutjs render in adminhtml

UPDATE: You can access the viewmodels directly. If you need to trigger code to run after a render, use MutationObserver. I'll post my code as soon as I have a good working example. Original Question:...
0
votes
1answer
140 views

How to add a span tag to template in the onepage checkout?

I need to add a span-Tag next to the radio-Buttons in the payment template of the checkout. And my question is HOW DO I DO THAT? I can't find any template that matchs. There are several templates for ...
2
votes
1answer
2k views

Extend a default Ui component in adminhtml

Is there any good example code on how to work with RequireJS and knockoutJS (built into magento2) for adding additional functionality to fields in the admin side? I'm looking for Magento docs and ...
1
vote
1answer
209 views

Magento2 Custom Template KnockoutJS

I have set up a custom template and all working fine apart from KO templating is not working in the custom theme so things lick the checkoutpage is not rendering. I have the following set: - One page ...
1
vote
1answer
701 views

How does Magento 2 process ko statements and how to use them?

In Magento 2 templates I've found some ko statements such as <form class="form form-shipping-address" id="co-shipping-form" data-bind="attr: {'data-hasrequired': $t('* Required Fields')}"> <...
2
votes
0answers
121 views

Use knockout.js in catalog page in magento 2

We are developing an extension for configurable products which provides the following functionality on product page. On the product view page of the configurable product, when the customer finishes ...
10
votes
2answers
4k views

Magento 2 Add to cart frontend event listener

I am trying to find good solution to execute custom javascript when product is successfully added to cart. Also this custom javascript need information about product that was added to cart (sku, qty, ...
3
votes
1answer
1k views

How to add an IMG in knockout html template

I am trying to show an image in the knockout template but I could not. This is what I have: <img data-bind="attr: {'src': getImage()}, src: getImage()" /> <p data-bind="html: ...
0
votes
0answers
114 views

how to delete an input field in knockoutjs template in magento2

On checkout page, there is a company field that I need to remove from the shipping address form. Furthermore, I need to change the city and region fields to make them dependent dropdowns. I have ...
2
votes
0answers
4k views

Swatch customization issues

well we have heavily customized Magento 2 website. The swatch customizing is done in: app\code\My_Package\CustomSwatches\view\frontend\web\js\SwatchRenderer.js by overriding: vendor\magento\module-...
12
votes
2answers
12k views

How to use Knockout JS within Magento 2

My problem: I am attempting to write a small Knockout JS app within Magento 2, I'm struggling to initialise the app as when I use ko.applyBindings(AppViewModel, document.getElementById("koTest")); it ...
2
votes
2answers
3k views

Magento2 Knockout js - issue on cart

I tried to reposition my cart block to a other header location. Since then I am getting this javascript error which is annoying since I only repositioned a block. Uncaught TypeError: Unable to ...
3
votes
1answer
5k views

Magento 2 knockout template rendering via getTemplate

I have been checking out M2's frontend structure and I stumbled in some knockoutjs's template binding, for example in Magento/Checkout/view/frontend/web/template/shipping-address/form.html(this file ...
3
votes
2answers
4k views

How to extend js class/method of checkout model class in magento 2

Basically I need to some method overwrite/extend of following Js class. magento/module-checkout/view/frontend/web/js/model/step-navigator.js Overwrite of this class through requirejs working fine. ...
12
votes
2answers
12k views

magento2 knockoutjs custom template binding

I'm trying to understand knockoutjs in magento2.especially custom template binding.I'm not able to get idea flow of rendering this. Can any one have idea how it works? atleast Where can I find ...
31
votes
2answers
17k views

In Magento2 what is <script type=“text/x-magento-init”>?

I am new to Magento2 and our organisation has just get the EE licence. I have installed it on my local machine and the default template spits out the following mixed in with HMTL: <script type="...
4
votes
1answer
229 views

Interconnecting two different Knockout “apps” on the same page in Magento 2

I have two blocks with a jsLayout in the layout XML on a single page. Both are initialized via <script type="text/x-magento-init"> { "#checkout": { "...
9
votes
2answers
2k views

Overriding template files in own theme, loaded through JS (Knockout.js)

Since the official Magento 2.0 forums aren't of any help, i'll post my question here as well. We're in the process of building our own theme based on the Magento Blank theme and we would like to ...
15
votes
1answer
2k views

Magento 2 new grid system template

I've been poking around in the new backend grid system of Magento on the Merchant beta 1.0.0 version. First of all I must say I'm impressed. Now you can select what columns to see, you can reorder ...

1
10 11 12 13
14