Questions tagged [knockout.js]
Knockout.js is an open source JavaScript library for dynamic HTML UIs using the Model-View-View Model (MVVM) pattern.
knockout.js
20,503
questions
2
votes
3
answers
11k
views
Knockout js - && in if condition and containerless binding
I am displaying a list of items and if the items are not available I have to display a default message. Now, I have to check whether the object has been created and then check the object has the list ...
0
votes
0
answers
27
views
Bind CSS with knockout Secure Bindings
How Can I bind CSS to a div using knock out secure bindings.
The following piece of code is not working.
data-sbind="css:{'has-error': isNullOrWhiteSpace($root.UserID()) == true,'MandatoryFields':...
0
votes
0
answers
56
views
How to re-render dropdown with search text data filtered
I am using a bootstrap selectpicker with knockout.js binding which has multiselect as well as data-live-search properties on.
Here is a scenario
Steps:
Open dropdown, type ‘cat’ in dropdown
Due to ...
4
votes
1
answer
9k
views
Export To Excel from Asp Net Web API Controller
I am working on New web application which is Using Web API as Business Layer and Knock out Js as client side frame work to binding. I have a requirement like Pass the certain search criteria to Web ...
2
votes
1
answer
1k
views
Knockout AJAX data sent to C# controller is null
I'm trying to post a list of colors (id numbers) to a test function in my controller. I know the data is being sent and looks like it's formed correctly.
When I send the data fiddler shows this:
[{"...
0
votes
0
answers
26
views
Form validation is not working using Knockout.js SPA
I have created a Single Page Application in which create three HTML Pages names: 1. Index.html (Master Page), 2. Home.html, and 3. Contact.html and also two JavaScript Pages: 1. Index.js (for Master ...
0
votes
4
answers
299
views
JSON object to Javascript object
Im looking for a simple script to convert JSON objects to Javascript objects, specifically being able to make an ajax call in jQuery and then convert all of the JSON that comes back into Javascript ...
0
votes
1
answer
32
views
Conditional html heading tag based on variable in knockout.js
Is it possible to set the html element in knockout.js programmatically?
For example, the user can choose the heading level (from h1 - h6 and p if it's no heading).
And in frontend I then have a ...
1
vote
1
answer
1k
views
Knockout.js hasfocus causes value to be reset when losing focus before the throttle period expires
Here is a little sample code which illustrates my problem: http://jsfiddle.net/wsytR/2/
If you change the text in the input and then press tab to blur it the value changes back to the old one. This ...
26
votes
7
answers
50k
views
PDFMAKE: 'Roboto-Regular.ttf' not found in virtual file system ONLY AFTER GULP
I created a simple app using knockout/bootstrap/gulp that downloads a pdf using pdfMake.js. It works fine in debug mode using VS2017. After publishing and using gulp it gives this error when run: File ...
0
votes
0
answers
31
views
Cast a string name to model name which already exists in knockout JS
I am working on a dynamic validation setting in Knockout JS. I blocked by one scenario, I am getting viewmodel name as string from db with control id. This model name is a string name like “testModel....
0
votes
0
answers
61
views
magento 2.4.6 knockout.js:3753 Uncaught TypeError: Unable to process binding "visible: function(){return isVisible() }"
in magento 2.4.6 getting bellow error. i can not found solution so if anyone can help me then it will be great.
knockout.js:3753 Uncaught TypeError: Unable to process binding "visible: function(){...
0
votes
0
answers
47
views
Force Magento 2's checkout accordion to be open on first step, closed on second step
This is my Magento_Checkout/web/template/summary/cart-items.html
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div class="...
2
votes
1
answer
233
views
Apexcharts <svg> attribute height: Expected length, "NaN" when loading other page
I have a simple chart generated with ApexCharts v3.45.1. This is on a single page application where when I fetch another page via an AJAX call, the original chart in the DOM is removed on purpose (...
0
votes
1
answer
32
views
Unable to process binding "value: function() {return myVar }"
I am using knockout.js and am trying to get a <select> tag to populate with options from on of the view model's properties. I think I did everything right but it breaks. The console error is
...