Skip to main content

Posts

Showing posts with the label Knockout js

Disconnected Architecture

Being a .Net Developer and using the open technologies, I have lots of options of taking the advantage of the framework but once you started growing in your career, more then What technology you use? the question become How the technology is used ? and that is Architecture. An architecture of a something you are implementing is very important once you start writing the code. If you are writing a mobile application that needs to be cross browser compatible and can work on on any mobile device, you need to follow the modern architecture that is getting common across all the application. The architecture should use SPA (Single Page Application) and REST api's and should be devoid of any stored proc to avoid complexity. Let's start with why to use SPA, A SPA is written in HTML5, JS, CSS3 and lots of other JS libraries. The other JS libraries has some basic needed libraries like .less or .sass for css maintenance, Require JS for correct Integration of code and ofcourse ...

Refresh the Jquery Css for a HTML control using knockout in Javascript.

If you are a JavaScript developer then you might have come across a situation where you load your HTML controls after the page load has happen, which is like dynamic binding of controls. And then you see your input type text doesn't have the proper Css as other inputs. You also load select (dropdown)  that also doesn't have the proper css. You are in chrome and press F-12 to inspect the element, y ou see that nothing is there in control, it is not applying the JQuery css. But the controls that are loaded in page load have it. What to do, no options just to manually copy the CSS classes. VERY BAD IDEA? Just do this, In HTML < input type ="date" data-bind ="i nputsRefresh: $element, value: $data.EndDate " /> and in JS binding handler