Giter Site home page Giter Site logo

emberjs-jqm's Introduction

Ember + jQuery Mobile Prototype

Description:

This is a very basic example of Ember.js and jQuery Mobile "playing nice" with one-another

Features / Problems:

  • FIX (list of features or problems)

Synopsis:

This project is a basic proof-of-concept demonstrating jQuery Mobile and Ember.js working together.

The app defines some custom Ember.js views that add the necessary data-roles to the corresponding elements.

App.ListView demonstrates a list control that observes the attached content array (an Em.ArrayProxy in this example) and refreshes the attached listview. This pattern would need to be used with any "complex" jQuery Mobile widgets/controls as jQuery Mobile is, of course, not aware of Ember.js data bindings. But that's what observers are for!

App.ListView = Em.CollectionView.extend({
    attributeBindings: ['data-role'],
    'data-role':'listview',
    tagName: 'ul',
    itemViewClass: App.ListItemView,

    // Observe the attached content array's length and refresh the listview on the next RunLoop tick.
    contentLengthDidChange: function(){
        console.log('listview changed');
        var _self = this;
        Em.run.next(function() {
            _self.$().listview('refresh');
        });
    }.observes('content.length')

});

Requirements:

This project includes everything you need.

Install:

  • Simply push this to your web server of choice.

emberjs-jqm's People

Contributors

luissala avatar mattkime avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.