a:20:{s:9:"#provides";s:24:"dojox.data.StoreExplorer";s:9:"#resource";s:21:"data/StoreExplorer.js";s:9:"#requires";a:4:{i:0;a:2:{i:0;s:6:"common";i:1;s:19:"dojox.grid.DataGrid";}i:1;a:2:{i:0;s:6:"common";i:1;s:23:"dojox.data.ItemExplorer";}i:2;a:3:{i:0;s:6:"common";i:1;s:28:"dijit.layout.BorderContainer";i:2;s:5:"dijit";}i:3;a:3:{i:0;s:6:"common";i:1;s:24:"dijit.layout.ContentPane";i:2;s:5:"dijit";}}s:24:"dojox.data.StoreExplorer";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:28:"dijit.layout.BorderContainer";}s:4:"call";a:1:{i:0;s:28:"dijit.layout.BorderContainer";}}s:10:"parameters";a:1:{s:7:"options";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:28:" dojo.mixin(this, options);";s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:30:"dojox.data.StoreExplorer.store";a:3:{s:9:"prototype";s:24:"dojox.data.StoreExplorer";s:8:"instance";s:24:"dojox.data.StoreExplorer";s:7:"summary";s:0:"";}s:38:"dojox.data.StoreExplorer.stringQueries";a:2:{s:9:"prototype";s:24:"dojox.data.StoreExplorer";s:7:"summary";s:0:"";}s:35:"dojox.data.StoreExplorer.postCreate";a:5:{s:9:"prototype";s:24:"dojox.data.StoreExplorer";s:4:"type";s:8:"Function";s:6:"source";s:2858:" var self = this; this.inherited(arguments); var contentPane = new dijit.layout.ContentPane({ region:'top' }).placeAt(this); function addButton(name, action){ var button = new dijit.form.Button({label: name}); contentPane.containerNode.appendChild(button.domNode); button.onClick = action; return button; } var queryText = contentPane.containerNode.appendChild(document.createElement("span")); queryText.innerHTML = "Enter query:  "; queryText.id = "queryText"; var queryTextBox = contentPane.containerNode.appendChild(document.createElement("input")); queryTextBox.type = "text"; queryTextBox.id = "queryTextBox"; addButton("Query",function(){ var query = queryTextBox.value; self.setQuery(self.stringQueries ? query : dojo.fromJson(query)); }); contentPane.containerNode.appendChild(document.createElement("span")).innerHTML = "   "; var createNewButton = addButton("Create New", dojo.hitch(this, "createNew")); var deleteButton = addButton("Delete",function(){ var items = grid.selection.getSelected(); for (var i = 0; i < items.length; i++){ self.store.deleteItem(items[i]); } }); this.setItemName = function(name){ createNewButton.attr('label'," Create New " + name); deleteButton.attr('label',"Delete " + name); } addButton("Save",function(){ self.store.save(); //refresh the tree self.tree.refreshItem(); }); addButton("Revert",function(){ self.store.revert(); }); addButton("Add Column", function(){ var columnName = prompt("Enter column name:","property"); if(columnName){ self.gridLayout.push({ field: columnName, name: columnName, formatter: dojo.hitch(self,"_formatCell"), editable: true }); self.grid.attr("structure",self.gridLayout); } }); var centerCP = new dijit.layout.ContentPane({ region:'center' }).placeAt(this); var grid = this.grid = new dojox.grid.DataGrid( {store: this.store} ); centerCP.attr("content", grid); grid.canEdit = function(inCell, inRowIndex){ var value = this._copyAttr(inRowIndex, inCell.field); return !(value && typeof value == 'object') || value instanceof Date; } var trailingCP = new dijit.layout.ContentPane({ region: 'trailing', splitter: true, style: "width: 300px" }).placeAt(this); var tree = this.tree = new dojox.data.ItemExplorer({ store: this.store} ); trailingCP.attr("content", tree); dojo.connect(grid, "onCellClick", function(){ var selected = grid.selection.getSelected()[0]; tree.setItem(selected); }); this.gridOnFetchComplete = grid._onFetchComplete; this.setStore(this.store);";s:7:"summary";s:0:"";s:9:"classlike";b:1;}s:33:"dojox.data.StoreExplorer.setQuery";a:5:{s:9:"prototype";s:24:"dojox.data.StoreExplorer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"query";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:28:" this.grid.setQuery(query);";s:7:"summary";s:0:"";}s:36:"dojox.data.StoreExplorer._formatCell";a:6:{s:9:"prototype";s:24:"dojox.data.StoreExplorer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:122:" if(this.store.isItem(value)){ return this.store.getLabel(value) || this.store.getIdentity(value); } return value;";s:7:"private";b:1;s:7:"summary";s:0:"";}s:33:"dojox.data.StoreExplorer.setStore";a:5:{s:9:"prototype";s:24:"dojox.data.StoreExplorer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"store";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:1665:" this.store = store; var self = this; var grid = this.grid; grid._pending_requests[0] = false; function formatCell(value){ return self._formatCell(value); } var defaultOnComplete = this.gridOnFetchComplete; grid._onFetchComplete = function(items, req){ var layout = self.gridLayout = []; var column, key, item, i, j, k, idAttributes = store.getIdentityAttributes(); for(i = 0; i < idAttributes.length; i++){ key = idAttributes[i]; layout.push({ field: key, name: key, _score: 100, formatter: formatCell, editable: false }); } for(i=0; item = items[i++];){ var keys = store.getAttributes(item); for(k=0; key = keys[k++];){ var found = false; for(j=0; column = layout[j++];){ if(column.field == key){ column._score++; found = true; break; } } if(!found){ layout.push({ field: key, name: key, _score: 1, formatter: formatCell, styles: "white-space:nowrap; ", editable: true }); } } } layout = layout.sort(function(a, b){ return a._score > b._score ? -1 : 1; }); for(j=0; column = layout[j]; j++){ if(column._score < items.length/40 * j){ layout.splice(j,layout.length-j); break; } } for(j=0; column = layout[j++];){ column.width=Math.round(100/layout.length) + '%'; } grid._onFetchComplete = defaultOnComplete; grid.attr("structure",layout); var retValue = defaultOnComplete.apply(this, arguments); } grid.setStore(store); this.queryOptions = {cache:true}; this.tree.setStore(store);";s:7:"summary";s:0:"";}s:34:"dojox.data.StoreExplorer.createNew";a:4:{s:9:"prototype";s:24:"dojox.data.StoreExplorer";s:4:"type";s:8:"Function";s:6:"source";s:233:" var props = prompt("Enter any properties to put in the new item (in JSON literal form):","{ }"); if(props){ try{ this.store.newItem(dojo.fromJson(props)); }catch(e){ alert(e); } }";s:7:"summary";s:0:"";}s:36:"dojox.data.StoreExplorer.setItemName";a:2:{s:8:"instance";s:24:"dojox.data.StoreExplorer";s:7:"summary";s:0:"";}s:29:"dojox.data.StoreExplorer.grid";a:2:{s:8:"instance";s:24:"dojox.data.StoreExplorer";s:7:"summary";s:0:"";}s:29:"dojox.data.StoreExplorer.tree";a:2:{s:8:"instance";s:24:"dojox.data.StoreExplorer";s:7:"summary";s:0:"";}s:44:"dojox.data.StoreExplorer.gridOnFetchComplete";a:2:{s:8:"instance";s:24:"dojox.data.StoreExplorer";s:7:"summary";s:0:"";}s:47:"dojox.data.StoreExplorer.postCreate.setItemName";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"name";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:215:" createNewButton.attr('label'," Create New " + name); deleteButton.attr('label',"Delete " + name);";s:8:"instance";s:35:"dojox.data.StoreExplorer.postCreate";s:7:"summary";s:0:"";}s:37:"dojox.data.StoreExplorer.queryOptions";a:2:{s:8:"instance";s:24:"dojox.data.StoreExplorer";s:7:"summary";s:0:"";}s:4:"this";a:2:{s:6:"mixins";a:1:{s:6:"normal";a:1:{i:0;s:7:"options";}}s:7:"summary";s:0:"";}s:10:"dojox.data";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dojox";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}