iips-dc / iips_website

IIPS website project.
3 stars 2 forks source link

Knockout Js on each page #29

Closed Ankit-Kulkarni closed 10 years ago

Ankit-Kulkarni commented 10 years ago

Please see this issue asap .

Kncokout.js is not working in our system. If any body can workout with even a small example in our site , please let me know.

Rahul-Sagore commented 10 years ago

I could not understand what are you talking but knockout.js is working on our project. I did it yesterday on "Student_verification" page using knockout's "Real time updation of a div's content while user types in the input box" , I did not pushed it on github because I want to update the div by checking on database. But for example I will push it on github asap.

Rahul-Sagore commented 10 years ago

Knockout is working fine. I have added a sample code on 'Student_verfication' page. Pull the changes & check. The reason that knockout did not worked on your system because you had used knockout's 'Click' & 'Visible' event , but you have not defined it on knockout script (You would have defined it but it did not worked because there might be problem in your script definition).

It did not worked today in DC because by default knockout's code is applied to whole page and there was no definition of data-bind you used in the code. If you want to invoke it for a particular div then you have to pass second parameter in ko.applyBindings(viewModel, document.getElementById('id')); it will apply bindings for a div whose id = 'id'.