/* * This file is provided for custom JavaScript logic that your HTML files might need. * Maqetta includes this JavaScript file by default within HTML pages authored in Maqetta. */ window.addEventListener("load", function(){ // Browser load event: browser is ready if(dojo && dojo.ready){ // See if dojo toolkit has been included dojo.ready(function(){ // dojo ready event: dojo is ready // logic that requires that Dojo is fully initialized should go here //Create new data for data store var myData = { identifier: "unique_id", items: [ {unique_id:1, id: "IN", label: "Indiana"}, {unique_id:2, id: "MN", label: "Minnesota"}, {unique_id:3, id: "TX", label: "Texas"} ] }; //Set new data on data store (the store has jsId set, so there's //a global variable we can reference). More info on resetting //data in data store here: http://tinyurl.com/cn5tqek ItemFileReadStore_1.clearOnClose = true; ItemFileReadStore_1.data = myData; ItemFileReadStore_1.close(); //Get reference to our grid object. I set the id to "GridX" using //the Maqetta properties palette. var myGridX = dijit.byId("myGridX"); //Cause our grid to reset itself (more info on GridX APIs //here: http://tinyurl.com/7gk4xjv myGridX.setStore(ItemFileReadStore_1); //Optionally change column structure on the grid myGridX.setColumns([ {field:"id", name: "State Abbreviation"}, {field:"label", name: "State Name"}, ]); }); } });