• 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

    Build Tag: gallery-2010.03.23-17-54

    Return to DataSource Wrapper

    YUI({
    	ignore : ['yui2-datasource'] // Can skip loading the yui 2 datasource
    }).use('datasource','gallery-datasource-wrapper','yui2-datatable','yui2-paginator',function (Y) {	
     
    	// Create a DataSource instance normally
    	var ds = new Y.DataSource.IO({source : '/test.php?'});
    	ds.plug({fn : Y.Plugin.DataSourceCache, cfg : {max : 5}});
    	ds.plug({fn : Y.Plugin.DataSourceJSONSchema, cfg : {
    		schema : {
    			resultListLocator : 'data.results',
    			resultFields : ['id', 'lastName', 'firstName', 'lastAccess'],
    			metaFields : {
    				totalRecords : 'data.total'
    			}
    		}
    	}});
     
    	// Instantiate the wrapper and set the source
    	var wrappedDS = new Y.DataSourceWrapper({
    		source : ds
    	});
     
    	var cols = [
    		{key : 'id', label : 'ID'},
    		{key : 'firstName', label : 'First Name'},
    		{key : 'lastName', label : "Last Name"},
    		{key : 'lastAccess', label : "Last online"}
    	];
     
    	// Create a simple YUI2 Paginator instance	
    	var pager = new Y.YUI2.widget.Paginator({
    		rowsPerPage : 5
    	});
     
    	// Create a DataTable
    	var dt = new Y.YUI2.widget.DataTable('tableContainer', cols, wrappedDS, {
    		paginator : pager,
    		dynamicData : true
    	});
     
    	// Response functions are handled normally
    	dt.handleDataReturnPayload = function (request, response, payload) {
    		payload.totalRecords = response.meta.totalRecords;
    		return payload;
    	};
    });
     

    Build Output

    /home/y/libexec/ant/bin/ant all
    Buildfile: build.xml
         [echo] Starting Build For gallery-datasource-wrapper
         [echo] Ant Properties
         [echo]     Home : /home/y/libexec/ant
         [echo]     Ant Version : Apache Ant version 1.7.1 compiled on June 27 2008
         [echo]     Build File : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-datasource-wrapper/build.xml
         [echo] Local Build Properties
         [echo]     version : 3
         [echo]     srcdir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery
         [echo]     builddir : ../../../builder/componentbuild
         [echo]     component : gallery-datasource-wrapper
         [echo]     component.basefilename : gallery-datasource-wrapper
         [echo]     component.basedir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-datasource-wrapper
         [echo]     component.builddir : ../../tmp
         [echo] Global Build Properties
         [echo]     global.build.base : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build
         [echo]     global.build.component : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-datasource-wrapper
         [echo]     global.build.component.assets : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-datasource-wrapper/assets
    
    clean:
    
    init:
        [mkdir] Created dir: /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/tmp
    
    -concatdebug:
         [echo] Concatenating
         [echo]     Source Files : wrapper.js
         [echo]     In Source Dir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-datasource-wrapper/js
         [echo]     To : ../../tmp/gallery-datasource-wrapper-debug.js
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/tmp/ant
       [delete] Deleting directory /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/tmp/ant
    
    -registerdebug:
         [echo] Wrapping ../../tmp/gallery-datasource-wrapper-debug.js in YUI.add module
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/tmp
    
    -prependdebug:
    
    -appenddebug:
    
    builddebug:
    
    -createcore:
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/tmp
    
    -loggerregex:
         [echo] Replacing Logger Statements in ../../tmp/gallery-datasource-wrapper.js
    
    buildcore:
    
    -rollupjs:
    
    -concatskins:
    
    -buildskins:
    
    -rollupcss:
    
    buildskins:
    
    -buildlangs:
    
    -rolluplangs:
    
    buildlangs:
    
    build:
    
    minify:
         [echo] Running yuicompressor on ../../tmp/gallery-datasource-wrapper.js
         [java] 
         [java] [WARNING] Found an undeclared symbol: YUI
         [java]  ---> YUI <--- .add("gallery-datasource-wrapper",function(Y){
    
    lint:
         [java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/tmp/gallery-datasource-wrapper-debug.js
         [java] - OK
         [java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/tmp/gallery-datasource-wrapper-min.js
         [java] - OK
         [java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/tmp/gallery-datasource-wrapper.js
         [java] - OK
    
    local:
    
    deploybuild:
         [copy] Copying 3 files to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-datasource-wrapper
    
    deployassets:
    
    deployskins:
    
    deploylang:
    
    deploydocs:
    
    deploy:
    
    all:
    
    BUILD SUCCESSFUL
    Total time: 2 seconds

    © 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