1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.BuilderDatabase = new Roo.XComponent({
6 part : ["Builder","Database"],
7 order : '999-Pman.Tab.BuilderDatabase',
9 parent : 'Pman.Tab.Builder',
10 name : "Pman.Tab.BuilderDatabase",
18 xtype: 'NestedLayoutPanel',
21 activate : function (_self)
23 _this.treepanel.tree.root.reload();
28 title : "Manage Database",
30 xtype: 'BorderLayout',
37 render : function (_self)
39 _this.treepanel = _self;
51 click : function (_self, e)
53 _this.treepanel.tree.root.reload();
56 text : "Refresh/Manage Tables",
64 text : "Add Table/Container"
74 click : function (_self, e)
78 url: baseURL + '/Roo/Builder_tables.php',
96 click : function (_self, e)
98 var node = _this.treepanel.tree.getSelectionModel().getSelectedNode();
101 Roo.MessageBox.alert('Error', 'Please select a table');
117 beforeload : function (node)
119 if (!_this.panel.active) {
123 contextmenu : function (node, e)
125 if (!node.expanded || node.leaf) {
129 _this.treepanel.menu = Roo.factory(_this.treepanel.menu);
130 _this.treepanel.menu.show(node.ui.anchor,'tr');
133 beforenodedrop : function (dropEvent)
136 var node = dropEvent.dropNode;
137 var targ = dropEvent.target;
138 var parent = dropEvent.target;
139 switch(dropEvent.point) {
142 parent = dropEvent.target.parentNode;
147 // technically you should not be able to drag tables into other modules..
148 if (parent.attributes.id < 1) {
149 dropEvent.cancel = 1;
152 url : baseURL + '/Roo/Builder_tables',
154 id : node.attributes.id,
155 parent_id : parent.attributes.id
162 containerScroll : true,
170 create : function (_self, attr)
174 attr.text = attr.name.length ? attr.name : attr.descrip;
176 attr.leaf = attr.name.length ? true : false;
177 attr.html = String.format('<B>{0}</B><i>{1}</i>',
188 queryParam : 'parent_id',
189 requestMethod : 'GET',
191 baseParams : { _tree: 1, 'sort': 'name', dir: 'ASC', limit : 9999 },
192 dataUrl : baseURL + '/Roo/Builder_tables.php'
195 xtype: 'MultiSelectionModel',
199 xtype: 'AsyncTreeNode',
207 beforenodeedit : function (_self,node)
209 Roo.log('before start edit');
210 Roo.log(this.editNode);
211 if (node.attributes.name.length) {
217 complete : function (_self, value, startValue)
219 Roo.log(this.editNode);
221 var attr = this.editNode.attributes;
223 var pa = this.editNode.parentNode.attributes;
238 url : baseURL + '/Roo/Builder_tables',
257 click : function (_self, e)
259 _this.nIndex = _this.nIndex || 0;
261 var m = _this.cxnode.firstChild ? 'insertBefore' : 'appendChild';
262 var tree = _this.treepanel.tree;
264 var n = tree.loader.createNode({
266 descrip :'New Group ' + (++_this.nIndex),
270 var node = _this.cxnode[m]( n , _this.cxnode.firstChild);
271 setTimeout(function(){
272 tree.editor.editNode = node;
273 tree.editor.startEdit(node.ui.textNode);
287 click : function (_self, e)
289 _this.nIndex = _this.nIndex || 0;
292 // try and delete it..
294 url : baseURL + '/Roo/Builder_tables',
296 _delete : _this.cxnode.attributes.id
298 success : function() {
299 _this.cxnode.parentNode.removeChild(_this.cxnode);
300 _this.cxnode = false;
307 text : "Remove Group"
316 activate : function() {
319 _this.grid.footer.onClick('first');
327 tableName : 'Tables',
336 //_this.dialog = Pman.Dialog.FILL_IN
337 if (_this.panel.active) {
338 this.footer.onClick('first');
341 rowdblclick : function (_self, rowIndex, e)
343 if (!_this.dialog) return;
344 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
345 _this.grid.footer.onClick('first');
349 autoExpandColumn : 'table',
355 sortInfo : { field : 'filename', direction: 'ASC' },
360 url : baseURL + '/Builder/ERM.php'
365 totalProperty : 'total',
402 'name': 'displayorder',
410 'name': 'parent_image_id',
416 'dateFormat': 'Y-m-d'
443 'name': 'parent_image_id_id',
447 'name': 'parent_image_id_filename',
451 'name': 'parent_image_id_ontable',
455 'name': 'parent_image_id_onid',
459 'name': 'parent_image_id_mimetype',
463 'name': 'parent_image_id_width',
467 'name': 'parent_image_id_height',
471 'name': 'parent_image_id_filesize',
475 'name': 'parent_image_id_displayorder',
479 'name': 'parent_image_id_language',
483 'name': 'parent_image_id_parent_image_id',
487 'name': 'parent_image_id_created',
491 'name': 'parent_image_id_imgtype',
495 'name': 'parent_image_id_linkurl',
499 'name': 'parent_image_id_descript',
503 'name': 'parent_image_id_title',
507 'name': 'parent_image_id_credit',
511 'name': 'parent_image_id_source',
518 xtype: 'PagingToolbar',
522 displayMsg : "Displaying Images{0} - {1} of {2}",
523 emptyMsg : "No Images found"
535 Roo.MessageBox.alert("Updating", "Updating the cache");
537 url : baseURL + '/Core/RefreshDatabaseCache',
539 success : function() {
540 Roo.MessageBox.hide();
545 cls : 'x-btn-text-icon',
546 text : "Refresh Schema",
547 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
553 xtype: 'ColumnModel',
558 renderer : function(v) { return String.format('{0}', v); }
565 xtype: 'LayoutRegion',
571 xtype: 'LayoutRegion',