• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    ModelList DataSource Plugin (gallery-modellist-datasource) on cdn

    Last Updated: 11/7/11
    + 2 -

    Greg Hinch

    YUI Contributor

    See 14 more by this user.

    Featured Item

    Created: 11/4/11
    Last CDN Push: 01/4/12
    Build Tag: gallery-2012.01.04-22-09
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.4.1
    Free for use.

    Provides a simple way to associate a DataSource with a ModelList. The DataSource "response" event will automatically insert the response data into the ModelList. By default it will replace the content of the ModelList, and via a single attribute it can "stack" the data as well

    • Tags:
    • data
    • modellist
    • datasource
    • greghinch
    • plugin
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Simply define a Model, ModelList, and a DataSource, and plug the ModelList with the DataSource.

    Code Sample

    <script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2012.01.04-22-09'
    }).use('gallery-modellist-datasource', function(Y) {
      var CustomModel = Y.Base.create('custom-model', Y.Model, [], {}, {
        ATTRS : {
          foo : {},
          bar : {}
        }
      });
      var ml = new Y.ModelList({model : CustomModel});
      var ds = new Y.DataSource.IO({source : '/path/to/data?'});
     
      ml.plug(Y.Plugin.ModelListDataSource, {
        source : ds,
      });
     
      ds.sendRequest({request : "baz=boo&zul=blah"}) // on response the ModelList will be updated
     
    });

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info