Marionette.jsまとめ その1 Application, Controller, AppRouter Marionette.jsまとめ その2 View, ItemView, CollectionView Marionette.jsまとめ その3 CompositeView, Layout, Region Marionette.CompositeView Marionette.CollectionViewを拡張したオブジェクトです。 CollectionViewと違い、テンプレートを設定する事ができます。 itemViewContainer itemViewのコンテナとなる要素をjQueryセレクタで指定します。 var FooItemView = Marionette.ItemView.extend({ template: '#itemTemplate' }); var Foo
Marionette.jsまとめ その1 Application, Controller, AppRouter Marionette.jsまとめ その2 View, ItemView, CollectionView Marionette.jsまとめ その3 CompositeView, Layout, Region Marionette.View Backbone.Viewを拡張したオブジェクトで、 他のMarionette.*Viewの基底クラスとなっています。 ここでは共通の処理やメソッドを定義しています。 bindUIElements uiに指定したセレクタに沿って jQueryオブジェクトをキャッシュします。 var FooView = Marionette.View.extend({ el: 'body', ui: { fooButton: '#fooButton', listI
Marionette.jsまとめ その1 Application, Controller, AppRouterJavaScriptBackbone.jsMarionette.js Marionette.jsまとめ その1 Application, Controller, AppRouter Marionette.jsまとめ その2 View, ItemView, CollectionView Marionette.jsまとめ その3 CompositeView, Layout, Region Marionette.jsとは Marionette.jsはBackbone.jsに下記等の機能を追加するライブラリです。 CollectionView, ItemViewなどViewタイプの追加 RegionとLayoutによるDOMの制御 モジュール機構 デストラクタ(elの削除、インスタンスの除
チュートリアルの続き。 さんざん伸ばした挙げ句、ようやくここからが、本番。 MarionetteのViewを使う。 また、長い記事になったので、先にソースあげておく。 https://github.com/lxyuma/todo-mario これから作るもの 前回、新規作成formを作ったので、 新規作成したtodoを表示するViewを作る。 liタグで、一つずつのTaskを表示する ulタグで、それらを束ねる liタグ用のView(1つ1つのTask) generatorをまた使う。 $ yo marionette:itemview task --create-all --create-allも付けると、templateも作ってくれる。 出来上がったソースに対して tagName: liを紐づける liをクリックしたらfinished:trueにして、線を引きたいので、 clickされた
marionette.jsのチュートリアルの続き。 ここから、クライアント側の話。 先に言うと、メインのmarionetteは、この記事でなく、その3なので読んで飽きてきたら、その3に飛ぶべし。 前回に引き続き、gruntを起動している状態で進める事。 もし、起動していなければ、gruntを起動する。 model 初めにmodel を作る。 railsみたいに、MVC,routerそれぞれのgeneratorが準備されているので、勿論それを使う。 $ yo marionette:model task create app/scripts/models/task.js invoke mocha-amd:unitTest create test/spec/models/task.js conflict test/spec/testSuite.js [?] Overwrite test/spec
Marionette.jsのチュートリアルを書く。 特に、yeoman製のgenerator-marionetteを使って、 railsみたいに、楽しながら、進めていく。 量が多くなったので、何度かに分けて書く。 この記事は、yeomanによる準備から、node+expressによるサーバー側まで。(baucis という楽チンな仕組みを使う) Marionette.jsとは? この前作ったslideをご参考に。 introduction to Marionette.js (jscafe14) from Ryuma Tsukano インストール 以下のgenerator-marionetteのgithubのページを参照 https://github.com/mrichard/generator-marionette#install 特にハマる事は無い。多分ね。 project作成 proje
Marionette.jsはBackbone.jsのラッパー的なライブラリです。 Backbone.jsの問題点 Backbone.jsは割と自由度が高いフレームワークなのですが、 それ故に中規模以上のプロジェクトで使おうとすると 設計が難しい(ベストプラクティスがわからずオレオレ実装になる) 初期化やインスタンスの管理が面倒 Viewは同じような処理が増える(で基底クラスにまとめたりする) といったデメリットがあります。 実際僕もよくわからないまま初期設計をした結果 大きな技術的負債を作ってしまった事がありました。 Marionette.js Marionette.jsはBackbone.jsと比べて抽象度が高く、 モジュール機構、CollectionView、Viewのデストラクタなど 独自実装になりがちな機能を提供してくれます。 これらを使う事で上に挙げたようなデメリットを回避し B
2012/11/14に開催された「なんでもないただの先端技術勉強会(仮)」にて、Backbone.jsの概要説明に使ったスライドです。
Backbone.js is quickly becoming the most popular framework for building modular client-side JavaScript applications. To help you tap the full potential of Marionette, Joseph Zimmerman prepared an entire eBook full of useful hands-on examples! To help you tap the full potential of Marionette, we’ve prepared an entire eBook full of useful hands-on examples which is also available in the Smashing Lib
In this series of posts, we’ll cover writing a simple Backbone.js application as a primer. You can see the live result here. The original application is at https://github.com/ddellacosta/backbone.js-examples/tree/master/collections3 and all design assets (CSS, images, etc.) are from there. This tutorial will show you how to use Derick Bailey’s Backbone.Marionette to build a simple application. But
The Backbone FrameworkMarionette simplifies your Backbone application code with robust views and architecture solutions. Download v4.1.2View Docs Organize your app in terms of small Views. Marionette makes it easy to compose rich layouts out of small components Show a sorted filtered list without breaking a sweat. Have a massive collection? Want to add or remove an item? No worries! Learn to love
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く