dinsdag 14 mei 2013

Very usefull plugin for KnockoutJS

Map that plain JavaScript object into a view model with the appropriate observables!


More info : http://knockoutjs.com/documentation/plugins-mapping.html
Download : https://github.com/SteveSanderson/knockout.mapping/tree/master/build/output

Add option to html dropdownlist with jQuery

$('#dropdownId').append($('<option>', { value: value, text: text , selected: true })); // Not selected option $('#dropdownId').append($('<option>', { value: value, text: text }));

Set a html checkbox to indeterminate state


var checkbox = document.getElementById('myCheckbox'); checkbox.indeterminate = true;