demo.html
First Name:
Last Name:
viewModel.js
function ProfileViewModel() {
this.profileClosure = ko.observable(false),
this.firstName = ko.observable("Alex");
this.lastName = ko.observable("Xaviar");
}
myViewModel = {
profileVM: ko.observable(),
initialize: function () {
myViewModel.profileVM = new ProfileViewModel();
ko.applyBindings(myViewModel);
}
}
ko-extensions.js
ko.bindingHandlers.closureMode= {
init: function (element, valueAccessor) {
var shouldClose = valueAccessor();
if (shouldClose) {
disableAll(element);
}
else
enableAll();
},
update: function (element, valueAccessor, allBindingsAccessor) {
var shouldClose = valueAccessor();
var allBindings = allBindingsAccessor();
var highlight = allBindings.highlight || false;
if (shouldClose){
disableAll(element);
}
else
enableAll(element);
if (shouldClose && highlight) {
highlightAll(element);
}
else
setToNormal(element);
}
};
function disableAll(element) {
$(element).find('#firstname').attr('disabled', true);
$(element).find('#lastname').attr('disabled', true);
}
function highlightAll(element) {
$(element).find('#firstname').addClass('highlight');
$(element).find('#lastname').addClass('highlight');
}
function enableAll(element) {
$(element).find('#firstname').attr('disabled', false);
$(element).find('#lastname').attr('disabled', false);
}
function setToNormal(element) {
$(element).find('#firstname').removeClass('highlight');
$(element).find('#lastname').removeClass('highlight');
$(element).find('#firstname').addClass('normal');
$(element).find('#lastname').addClass('normal');
}
This comment has been removed by the author.
ReplyDeleteThis is such a good post. One of the best posts that I\'ve read in my whole life. I am so happy that you chose this day to give me this. Please, continue to give me such valuable posts. Cheers!
ReplyDeletepython training in tambaram | python training in annanagar | python training in jayanagar
This is a nice post in an interesting line of content.Thanks for sharing this article, great way of bring this topic to discussion.
ReplyDeleteJava training in Marathahalli | Java training in Btm layout
I have been meaning to write something like this on my website and you have given me an idea. Cheers.
ReplyDeleteData Science course in rajaji nagar | Data Science with Python course in chenni
Data Science course in electronic city | Data Science course in USA
Data science course in pune | Data science course in kalyan nagar
This blog is really helpful for me and got a basic knowledge in this topic. Waiting for more updates, kindly keep continuing.
ReplyDeleteEnglish Training Institutes in Bangalore
Spoken English Classes Bangalore
Best English Speaking Course in Bangalore
English Speaking Classes near me
Best English Training Institute in Bangalore
English Coaching in Bangalore
English Learning Center in Bangalore
best hand blender in india
ReplyDelete123movies
ReplyDeleteonline earning whatsapp groups
ReplyDeleteGreat content thanks for sharing this informative blog which provided me technical information keep posting.
ReplyDeleteAWS training in chennai | AWS training in annanagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery
I'm very much inspired when I've visited your blog. Your blog is really informative. Hope you will continue with new article.
ReplyDeleteaws training in chennai
aws course in chennai
Great post thanks for sharing this very useful post
ReplyDeleteBuilding Contractors in Chennai
I like this one...more helpful information provided here.I am quite sure I will learn much new stuff right here! Good luck for the next!
ReplyDeleteAzure Training Institute In Hyderabad
"Enhance your data visualization skills with our comprehensive tableau course designed for beginners and professionals alike. Learn to create interactive dashboards and insightful reports to make data-driven decisions."
ReplyDeletePython online learning offers flexible education options.
ReplyDeleteIt allows learning from anywhere.
Practice improves consistency.
This
Python online
training supports modern learners.
It is convenient.
"Enhance your data analytics skills with comprehensive microsoft power bi training Learn to visualize, analyze, and share insights effectively for smarter business decisions."
ReplyDeleteAn android app development training program helps learners create modern mobile applications. It focuses on real-world coding practice and UI implementation. This android app development training improves development accuracy and performance optimization. It strengthens logical thinking. The curriculum follows industry standards. It supports long-term career success.
ReplyDeletePower BI course online offers complete knowledge of transforming raw data into meaningful reports. It explains Power Query and visualization tools clearly. This power bi course online enhances analytical thinking and decision-making skills. Learners complete real-time exercises. Industry projects are included. Certification guidance is provided. It prepares job-ready professionals.
ReplyDeleteAn iOS mobile app development course teaches learners how to build interactive and user-friendly applications for Apple mobile devices. It explains development tools, application architecture, and coding techniques clearly. This ios mobile app development course helps students gain hands-on programming experience. Learners practice development through exercises and projects. Projects provide real-world application development experience. The course prepares learners for professional iOS development careers.
ReplyDeleteThis topic is very relevant in today’s IT industry. Professionals often explore resources like microsoft learn devops to understand modern development practices.
ReplyDeleteInformative discussion. With cloud and automation growing rapidly, many learners are looking for programs like azure devops course online to enhance their skills.
ReplyDeleteGood points mentioned here. Flexible learning platforms offering an azure devops online course help professionals stay updated with new technologies.
ReplyDeleteThanks for sharing this perspective. Many professionals preparing for cloud roles are exploring programs such as the az 400 course to strengthen their DevOps knowledge.
ReplyDeleteInteresting read! As DevOps continues to grow in demand, many learners look for the best azure devops course to advance their careers.
ReplyDeleteGreat post! Our data modeling course
ReplyDeletehelps you design efficient databases and build career-ready skills with hands-on practice.