Questions tagged [data-bind]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer

Magento2. KnockoutJs. Define Scope and call function on the same html node

I have a very simple Component define([ 'uiComponent', 'Magento_Customer/js/customer-data' ], function (Component, customerData) { 'use strict'; return Component.extend({ /** @...
vitoriodachef's user avatar
0 votes
0 answers

How to use js from library inside data-bind scope

I'm trying to use sortable with below code: <ul id="sortable-list"> <li> <div> <span class="sort-handle">Sortable Item #1</span&...
Harry Nguyen's user avatar
  • 2,815
0 votes
1 answer

How to get window.checkoutConfig value in html file using data-bind

I made my custom delivery method programmatically. It also appears in the Magento 2 admin config section. It is a multi-select field with values of days of the week. In my js file below: define( [ ...
Muhammad Muiz Ather's user avatar
1 vote
0 answers

Accordion not working after ajax data update : M2

At page load accordion is working good, but when i replace whole id="accordion" div using ajex after that accordion isn't working. In ajax content have same html structure as below. <div ...
Jimit Bhavsar's user avatar
0 votes
1 answer

Magento 2 bind ko scope to a non-html/virtual element

I want to bind customer scope to a non-html element as I do not want html to be loaded if customer is not logged in. In the OOTB magento inside vendor/magento/module-theme/view/frontend/templates/html/...
Sejal Shah's user avatar
  • 2,141
1 vote
1 answer

How to populate Purchase Order Number with a random rumber?

Magento 2.3.x Purchase Order used as a payment method requieres a purchase order number. Some of our customers don't have that number, so we need to pre-populate this input field with a random content ...
Tequila's user avatar
  • 11
2 votes
1 answer

Magento2: How to pass data from model file to knockout.js?

I want to pass the data from model file to knockout.js in Magento2. My Code: Model file: <?php namespace Amy\MyPackage\Model\Total\Quote; /** * Class Custom * @package Mageplaza\HelloWorld\Model\...
Amy's user avatar
  • 935
0 votes
1 answer

How to pass text input value to js in magento 2 knockout js?

In my template.html file, I am having only the input field. After I complete entering the text in the input field, I need to pass the value to the js file without any button click. How to achieve this ...
Arul's user avatar
  • 309
2 votes
2 answers

Magento 2 - cart page custom UI component foreach binding

I want to add a custom UI component template on the cart page. The data is in JSON format and wants to bind forach to display a list of data. data like as {'name':'5% discount','description':'5% ...
Shailesh Katarmal's user avatar
1 vote
0 answers

Magento 2 - bind to .html template load complete event

I need to do some DOM manipulation within a JS mixin after .html template is loaded. My mixin is for following component: module-braintree/view/frontend/web/js/view/payment/method-renderer/hosted-...
Robert Sargsyan's user avatar
0 votes
1 answer

Magento2: Function of enable/disable (yes/no) button for any module

I Have a module for the new shipment method with dropdown option (yes/no), to enable and disable the module function. I want to know how the module function works off while select No, and module work ...
irshad's user avatar
  • 171
1 vote
0 answers

Slick Slide After Scroll Slide is Working Magento2

I have used Slick Slider for Product Comparison in Magento 2.3. The issue here is when I scroll alone the slick slider gets activated. But I need to load slider before. Its Like I Am new to ...
Script Host's user avatar
0 votes
1 answer

Concatenate static Image path with KnockoutJS data-bind

This is my JS File code define([ 'uiComponent' ], function (Component) { 'use strict'; var some_products = window.checkoutConfig.my_specificProducts; return Component.extend({ ...
HaFiz Umer's user avatar
  • 1,661