• 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.

    This module has been deprecated and is no longer supported by the module author.

    Data Finder (gallery-datafinder)

    Last Updated: 10/22/10

    Greg Hinch

    YUI Contributor

    See 14 more by this user.

    Created: 11/25/09
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.2.0
    Free for use.

    The DataFinder class is a utility that works with a Y.DataSource instance to generate query strings, keep track of previously set query parameters, and turn a list of results into a RecordSet. The Record and RecordSet classes are currently almost direct ports of those classes in the YUI 2 DataTable widget.

    • Tags:
    • greghinch
    • record
    • recordset
    • data
    • finder
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    DataFinder is fairly simple to use, you start by creating a DataSource instance and configuring that with your DataSchema. You then instantiate a DataFinder and attach the DataSource, subscribe to the success and failure events, set any number of query parameters, and execute a fetch.

    Code Sample

    YUI().use('gallery-datafinder', function(Y) {
        var ds = new Y.DataSource.IO({
            source : 'test.php?action=testFn'
        });
     
        ds.plug({fn : Y.Plugin.DataSourceJSONSchema, cfg : {
            schema : {
                resultListLocator : "results.list",
                resultFields : [
                    "name",
                    "email"
                ]
            }
        }});
     
        var df = new Y.DataFinder({
            dataSource : ds
        });
     
        df.after('success', function (args) {
            if (args.records) {
                var myRecordSet = args.records;
                // use RecordSet
            }
        });
     
        df.after('failure', function (args) {
            // Handle the IO failure
        });
     
        df.setParam('foo', 'bar');
        df.fetch();
    });

    Forum Posts

    No forum posts for this module.

    © 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