The code for the Account CRUD is done and working, right? Or maybe there is something not working perfectly, caused from jQuery Mobile Widget enhancement?
If you create an Account with the type bank
, and then you try to edit it, you'll see the cash
type selected in the select field.
The reason behind this bug is that jQuery Mobile enhances the form components modifying the DOM structure, so you have to fix how the KnockoutJS binding handlers work in a few cases (like the value
).
In this case, we have to modify the binding handler value
to make it work with select
; let's create www/app/binding-handlers/selectValue.js
:
define(function (require) { var ko = require("knockout"), $ = require("jquery"); ko.bindingHandlers.selectValue = { init: function (element, valueAccessor) { var value = valueAccessor(), $element = $(element); ko.bindingHandlers.value.init.apply...