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)
99 var node = _this.treepanel.tree.getSelectionModel().getSelectedNode();
102 Roo.MessageBox.alert('Error', 'Please select a table');
106 Roo.log(node.attributes.name);
109 url : baseURL + '/Roo/Builder_tables.php',
114 success : function() {
131 beforeload : function (node)
133 if (!_this.panel.active) {
137 contextmenu : function (node, e)
139 if (!node.expanded || node.leaf) {
143 _this.treepanel.menu = Roo.factory(_this.treepanel.menu);
144 _this.treepanel.menu.show(node.ui.anchor,'tr');
147 beforenodedrop : function (dropEvent)
150 var node = dropEvent.dropNode;
151 var targ = dropEvent.target;
152 var parent = dropEvent.target;
153 switch(dropEvent.point) {
156 parent = dropEvent.target.parentNode;
161 // technically you should not be able to drag tables into other modules..
162 if (parent.attributes.id < 1) {
163 dropEvent.cancel = 1;
166 url : baseURL + '/Roo/Builder_tables',
168 id : node.attributes.id,
169 parent_id : parent.attributes.id
176 containerScroll : true,
184 create : function (_self, attr)
188 attr.text = attr.name.length ? attr.name : attr.descrip;
190 attr.leaf = attr.name.length ? true : false;
191 attr.html = String.format('<B>{0}</B><i>{1}</i>',
202 queryParam : 'parent_id',
203 requestMethod : 'GET',
205 baseParams : { _tree: 1, 'sort': 'name', dir: 'ASC', limit : 9999 },
206 dataUrl : baseURL + '/Roo/Builder_tables.php'
209 xtype: 'MultiSelectionModel',
213 xtype: 'AsyncTreeNode',
221 beforenodeedit : function (_self,node)
223 Roo.log('before start edit');
224 Roo.log(this.editNode);
225 if (node.attributes.name.length) {
231 complete : function (_self, value, startValue)
233 Roo.log(this.editNode);
235 var attr = this.editNode.attributes;
237 var pa = this.editNode.parentNode.attributes;
252 url : baseURL + '/Roo/Builder_tables',
271 click : function (_self, e)
273 _this.nIndex = _this.nIndex || 0;
275 var m = _this.cxnode.firstChild ? 'insertBefore' : 'appendChild';
276 var tree = _this.treepanel.tree;
278 var n = tree.loader.createNode({
280 descrip :'New Group ' + (++_this.nIndex),
284 var node = _this.cxnode[m]( n , _this.cxnode.firstChild);
285 setTimeout(function(){
286 tree.editor.editNode = node;
287 tree.editor.startEdit(node.ui.textNode);
301 click : function (_self, e)
303 _this.nIndex = _this.nIndex || 0;
306 // try and delete it..
308 url : baseURL + '/Roo/Builder_tables',
310 _delete : _this.cxnode.attributes.id
312 success : function() {
313 _this.cxnode.parentNode.removeChild(_this.cxnode);
314 _this.cxnode = false;
321 text : "Remove Group"
330 activate : function() {
333 _this.grid.footer.onClick('first');
341 tableName : 'Tables',
350 //_this.dialog = Pman.Dialog.FILL_IN
351 if (_this.panel.active) {
352 this.footer.onClick('first');
355 rowdblclick : function (_self, rowIndex, e)
357 if (!_this.dialog) return;
358 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
359 _this.grid.footer.onClick('first');
363 autoExpandColumn : 'table',
369 sortInfo : { field : 'filename', direction: 'ASC' },
374 url : baseURL + '/Builder/ERM.php'
379 totalProperty : 'total',
416 'name': 'displayorder',
424 'name': 'parent_image_id',
430 'dateFormat': 'Y-m-d'
457 'name': 'parent_image_id_id',
461 'name': 'parent_image_id_filename',
465 'name': 'parent_image_id_ontable',
469 'name': 'parent_image_id_onid',
473 'name': 'parent_image_id_mimetype',
477 'name': 'parent_image_id_width',
481 'name': 'parent_image_id_height',
485 'name': 'parent_image_id_filesize',
489 'name': 'parent_image_id_displayorder',
493 'name': 'parent_image_id_language',
497 'name': 'parent_image_id_parent_image_id',
501 'name': 'parent_image_id_created',
505 'name': 'parent_image_id_imgtype',
509 'name': 'parent_image_id_linkurl',
513 'name': 'parent_image_id_descript',
517 'name': 'parent_image_id_title',
521 'name': 'parent_image_id_credit',
525 'name': 'parent_image_id_source',
532 xtype: 'PagingToolbar',
536 displayMsg : "Displaying Images{0} - {1} of {2}",
537 emptyMsg : "No Images found"
549 Roo.MessageBox.alert("Updating", "Updating the cache");
551 url : baseURL + '/Core/RefreshDatabaseCache',
553 success : function() {
554 Roo.MessageBox.hide();
559 cls : 'x-btn-text-icon',
560 text : "Refresh Schema",
561 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
567 xtype: 'ColumnModel',
572 renderer : function(v) { return String.format('{0}', v); }
579 xtype: 'LayoutRegion',
585 xtype: 'LayoutRegion',