﻿YAHOO.util.Event.addListener(window, "load", function() {
    YAHOO.example.Basic = function() {
            var columns = [
                    { key: "Name", label: "Dataset", sortable: true },
                    { key: "Owner", label: "Source", sortable: true },
                    { key: "ShortOwner", label: "Organization", sortable: true },
                    { key: "Update", label: "Last update", sortable: false },
                    { key: "NextUpdate", label: "Next update", sortable: false }
                ];

            var dataSource = new YAHOO.util.DataSource(data.updateData);
            dataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
            dataSource.responseSchema = {
                fields: ["Name", "Owner", "ShortOwner", "Update", "NextUpdate"]
            };

            var updateInfoTable = new YAHOO.widget.DataTable("updateInfoTable", columns,
                        dataSource, { sortedBy: { key: "Name", dir: "asc"} });

            return {
                oDS: dataSource,
                oDT: updateInfoTable
            };
    } ();
});

