knockout.js

Bind any key (by keycode) to an action using Knockout

大憨熊 提交于 2021-02-19 06:22:51
问题 I'm looking for a method to bind many different keys to different actions/functions in my viewmodel. I've found this example where a binding handler is used to bind actions to the enter-key. But how do I modify this handler to also support a supplied key-code? I'd like to be able to use the same handler for all kinds of keys and preferably also combined with modifier keys. ko.bindingHandlers.executeOnEnter = { init: function (element, valueAccessor, allBindingsAccessor, viewModel) { var

Why is my ajax post being truncated?

匆匆过客 提交于 2021-02-18 20:12:43
问题 I have just updated my mvc service to include greater error and logging. I have now got this exact error several times. But cannot replicate. Unterminated string. Expected delimiter: ". Path 'Breadcrumbs[18].Params', line 1, position 59740. at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote) at The Path is different each time, depending on what the user is sending to the server. My ajax requests generally look like this: $.ajax(myURL("SendBreadcrumbs"), { type: "POST", cache:

Trigger Knockout-Event from outside

混江龙づ霸主 提交于 2021-02-11 07:19:20
问题 I have the following Select-Element in an html-form: <select multiple="multiple" data-bind="options: candidateList, optionsValue: 'id', optionsText: 'title', optionsAfterRender: setOptionTitle, selectedOptions: selectedCandidates, optionsAfterRender: setOptionTitle, event: { dblclick: addSelectedCandidate, change: candidateChanged }, enable: enabled()"> <option title="first" value="1">first</option> <option title="second" value="2">second</option> <option title="third" value="3">third</option

Trigger Knockout-Event from outside

一曲冷凌霜 提交于 2021-02-11 07:17:02
问题 I have the following Select-Element in an html-form: <select multiple="multiple" data-bind="options: candidateList, optionsValue: 'id', optionsText: 'title', optionsAfterRender: setOptionTitle, selectedOptions: selectedCandidates, optionsAfterRender: setOptionTitle, event: { dblclick: addSelectedCandidate, change: candidateChanged }, enable: enabled()"> <option title="first" value="1">first</option> <option title="second" value="2">second</option> <option title="third" value="3">third</option

Trigger Knockout-Event from outside

两盒软妹~` 提交于 2021-02-11 07:16:25
问题 I have the following Select-Element in an html-form: <select multiple="multiple" data-bind="options: candidateList, optionsValue: 'id', optionsText: 'title', optionsAfterRender: setOptionTitle, selectedOptions: selectedCandidates, optionsAfterRender: setOptionTitle, event: { dblclick: addSelectedCandidate, change: candidateChanged }, enable: enabled()"> <option title="first" value="1">first</option> <option title="second" value="2">second</option> <option title="third" value="3">third</option

“The JSON request was too large to be deserialized” MVC KnockoutJs

北战南征 提交于 2021-02-10 06:36:57
问题 I've been scrapping the threads for an answer in similar threads with no luck. I am using knockoutJS to pass the information back from my partial view and I am getting the "The JSON request was too large to be deserialized". I have done the " " fix but this isn't helping. My page has quiet a bit of information to pass back in the forms of lists, and I believe this is why I am getting the errors on this page and not others where I am using knockout. I have read that I can build my own

“The JSON request was too large to be deserialized” MVC KnockoutJs

扶醉桌前 提交于 2021-02-10 06:36:32
问题 I've been scrapping the threads for an answer in similar threads with no luck. I am using knockoutJS to pass the information back from my partial view and I am getting the "The JSON request was too large to be deserialized". I have done the " " fix but this isn't helping. My page has quiet a bit of information to pass back in the forms of lists, and I believe this is why I am getting the errors on this page and not others where I am using knockout. I have read that I can build my own

Knockout.js autocomplete bindingHandler [closed]

元气小坏坏 提交于 2021-02-08 20:37:36
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I'm trying my hand at an autocomplete handler for Knockout.js, and I'm looking for some feedback. This currently works, but I'm trying to see if I can get the job done without so many Eval()s all over the place,

Knockout.js autocomplete bindingHandler [closed]

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-08 20:37:20
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I'm trying my hand at an autocomplete handler for Knockout.js, and I'm looking for some feedback. This currently works, but I'm trying to see if I can get the job done without so many Eval()s all over the place,

Knockout.js autocomplete bindingHandler [closed]

人走茶凉 提交于 2021-02-08 20:37:18
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I'm trying my hand at an autocomplete handler for Knockout.js, and I'm looking for some feedback. This currently works, but I'm trying to see if I can get the job done without so many Eval()s all over the place,