Geeks With Blogs

News profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers

Donate Bitcoins

Check out Elapser from T3rse!
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.

Programming and Learning from SD Knockout Js http://www.knockoutjs.com
Selenium and timing issues
Our project uses KnockoutJS to data-bind data to our html elements (the same would be true for AngularJS binding). We’ve recently moved from testing against localhost to running our Selenium tests against an Azure hosted version of the same site. We’ve been noticing tests fail because of timing issues and the increased latency that weren’t there with the localhost tests. Discovered Approaches Use the driver.GetAndWaitForElement(By selector) method. This will help you make sure the DOM element is ......

Posted On Thursday, October 16, 2014 2:42 PM

Ajax promises without jQuery
I’m trying to move away from jQuery, since I’m using Knockout and AngularJS more all the time. I’ve always done my AJAX calls with the useful jQuery $.ajax( method. Searching for “ajax without jquery” brings up a lot of results, but they all include how to do it with jQuery. First a friend found a tutorial on ES6 promises on HTML5 rocks that included an example of “Promisifying XMLHttpRequest”. Since promises aren’t in all browsers yet (IE and Android Browser) you can polyfill with es6-promise. Or ......

Posted On Tuesday, October 7, 2014 4:20 PM

Quick KnockoutJS Example
I needed to show some developers how to use KnockoutJS instead of jQuery or MVC Razor server-side to create a table of values. I was able to show them in about 30 minutes and here is what I came up with. See my full interactive demo at jsFiddle.Net of the code below. The jsFiddle is more likely to change than the code below. <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title></title> </head> <body> <div> ......

Posted On Friday, October 3, 2014 4:51 PM

Handling IE 9 & 10's and Chrome’s clear button with Knockout binding
Our tester found a bug with my search box. The search box filters a grid using observables. IE 9 and 10, and Crome adds in a x clear option, this wasn’t changing the observable, so the filter wasn’t getting cleared out. (image from SO question) <input id="searchTextBox" class="searchTextBox" type="text" maxlength="25" title="Search" placeholder="Search" data-bind="value: GridVm.FilterText, valueUpdate: 'afterkeydown', disable: GridVm.Data().length == 0" /> I posted my question and ended up ......

Posted On Tuesday, May 7, 2013 11:02 AM

DataService and AjaxService for JavaScript
Here is what I’ve been using to make my JavaScript more modular and testable. I’m using JQuery’s promises and the Revealing Module Pattern. I got the idea for the DataServices from John Papa's Pluralsight course on Knockoutjs, but modified it to work with promises, instead of passing in the callback as a parameter. // DataService example: dataService.UiDataService = (function (ajaxService) { 'use strict'; var webServiceUrl = "/api/UiApi/", /** * @brief Get all the components from the service. */ ......

Posted On Friday, April 12, 2013 8:54 AM

Visual Studio 2012.2 Hanging When Editing Razor Pages
Since I installed the v2 update, Visual Studio has been hanging on occasion. The CPU for the process jumps to 25% and stays there and Visual Studio stops responding. I found a Microsoft Connect feedback which describes the same problem. It seems to be connected to intellisense for Knockout. There is a registry hack to turn it off, and this has worked for me. On March 13th, they report that the fix will be in VS Update 2, which is currently in CTP4 state (on March 19, 2013) with a “go-live” license.Update ......

Posted On Tuesday, March 19, 2013 8:06 AM

Knockout JS example
I did a short presentation at work to show off some of the capabilities of Knockout Js. Here’s a link to the read-only code from the Cloud 9 account. https://c9.io/aligned/knock... you're looking for an in-depth tutorial, I highly recommend John Papa's Pluralsight course ......

Posted On Wednesday, November 28, 2012 1:30 PM

Messaging with KnockoutJs
MVVM Light has Messaging that helps keep View Models decoupled, isolated, and keep the separation of concerns, while allowing them to communicate with each other. This is a very helpful feature. One View Model can send off a message and if anyone is listening for it, they will react, otherwise nothing will happen. I now want to do the same with KnockoutJs View Models. Here are some links on how to do this: http://stackoverflow.com/qu... ......

Posted On Wednesday, November 28, 2012 9:59 AM

Knockout Js and External MVC cshtml templates
I can pass the name of the template to the controller like this (/Templates/KnockoutTemplat... where 'radial' is the name of a view (radial.cshtml), return a partial view of that name and have Knockout put it in the template block. My Controller: public class TemplatesController : Controller{ public TemplatesViewModel viewModel { get; set; } public ActionResult KnockoutTemplate(string templateName, int? id) { this.viewModel.Id = id; return PartialView(templateName.Re... ......

Posted On Friday, August 17, 2012 8:18 AM

Wijmo and Knockout js
I get to be a part of a project that is re-writing dashboards from a Flash implementation to all HTML5. Our lead developer liked the Wijmo gadgets (as do I), so I've been putting the gadgets to the test. At the time of this writing we are using version 2.1.6. I really like how they look and they seem to perform well. I don't like the lack of information on how to style these and some of the other behaviors. Some of the requirements are:They have to be able to re-size with the browser and have the ......

Posted On Thursday, August 16, 2012 2:27 PM

Copyright © Aligned | Powered by: GeeksWithBlogs.net | Join free