Hacking bootstrap-datetimepicker to make it compatible with ember.js

today i will be talking a little bit about two wonderful  frameworks
  1. bootstrap
  2. ember.js

Bootstrap it’s amazing opensource framework about for creating your apps design it’s Elegant  Sleek, intuitive, and powerful front-end framework for faster and easier web development. now i am currently using it for all my apps it’s well documented and have a list of great components also it’s great to create a responsive application you can check it at http://twitter.github.io/bootstrap/ .

Ember is a great javascript framework it’s follow MVC pattern it’s still a new player in the community but i love to say it’s rails on the client you can find ember at http://emberjs.com/

one of the greatest plugin for bootstrap that i use it a lot is for http://tarruda.github.io/bootstrap-datetimepicker/

because ember.js is a new player you will find some compatibility issues with other plugins like datetimepicker i mention it above  so i will go fast about how to use it with ember.js

Problem: if you want to use to pass the input field value to the controller for example ember will not get the value of the input field unless you write it manualy in the textfield  the date and time picker plugin will not notify jquery that the input value is changed

Solution: adding this code to datetimepicker set method
if (!this.isInput) {

+ if (this.component){+  var input = this.$element.find(‘input’);+  $(‘#’+input.attr(‘id’)).change();+  }

+}

you will find my fork here

https://github.com/mido18/bootstrap-datetimepicker

Advertisements

About mido18

Student how addicted to computer and internet
This entry was posted in CS and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s