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',
115 success : function() {
132 beforeload : function (node)
134 if (!_this.panel.active) {
138 contextmenu : function (node, e)
140 if (!node.expanded || node.leaf) {
144 _this.treepanel.menu = Roo.factory(_this.treepanel.menu);
145 _this.treepanel.menu.show(node.ui.anchor,'tr');
148 beforenodedrop : function (dropEvent)
151 var node = dropEvent.dropNode;
152 var targ = dropEvent.target;
153 var parent = dropEvent.target;
154 switch(dropEvent.point) {
157 parent = dropEvent.target.parentNode;
162 // technically you should not be able to drag tables into other modules..
163 if (parent.attributes.id < 1) {
164 dropEvent.cancel = 1;
167 url : baseURL + '/Roo/Builder_tables',
169 id : node.attributes.id,
170 parent_id : parent.attributes.id
177 containerScroll : true,
185 create : function (_self, attr)
189 attr.text = attr.name.length ? attr.name : attr.descrip;
191 attr.leaf = attr.name.length ? true : false;
192 attr.html = String.format('<B>{0}</B><i>{1}</i>',
203 queryParam : 'parent_id',
204 requestMethod : 'GET',
206 baseParams : { _tree: 1, 'sort': 'name', dir: 'ASC', limit : 9999 },
207 dataUrl : baseURL + '/Roo/Builder_tables.php'
210 xtype: 'MultiSelectionModel',
214 xtype: 'AsyncTreeNode',
222 beforenodeedit : function (_self,node)
224 Roo.log('before start edit');
225 Roo.log(this.editNode);
226 if (node.attributes.name.length) {
232 complete : function (_self, value, startValue)
234 Roo.log(this.editNode);
236 var attr = this.editNode.attributes;
238 var pa = this.editNode.parentNode.attributes;
253 url : baseURL + '/Roo/Builder_tables',
272 click : function (_self, e)
274 _this.nIndex = _this.nIndex || 0;
276 var m = _this.cxnode.firstChild ? 'insertBefore' : 'appendChild';
277 var tree = _this.treepanel.tree;
279 var n = tree.loader.createNode({
281 descrip :'New Group ' + (++_this.nIndex),
285 var node = _this.cxnode[m]( n , _this.cxnode.firstChild);
286 setTimeout(function(){
287 tree.editor.editNode = node;
288 tree.editor.startEdit(node.ui.textNode);
302 click : function (_self, e)
304 _this.nIndex = _this.nIndex || 0;
307 // try and delete it..
309 url : baseURL + '/Roo/Builder_tables',
311 _delete : _this.cxnode.attributes.id
313 success : function() {
314 _this.cxnode.parentNode.removeChild(_this.cxnode);
315 _this.cxnode = false;
322 text : "Remove Group"
331 activate : function() {
334 _this.grid.footer.onClick('first');
342 tableName : 'Tables',
351 //_this.dialog = Pman.Dialog.FILL_IN
352 if (_this.panel.active) {
353 this.footer.onClick('first');
356 rowdblclick : function (_self, rowIndex, e)
358 if (!_this.dialog) return;
359 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
360 _this.grid.footer.onClick('first');
364 autoExpandColumn : 'table',
370 sortInfo : { field : 'filename', direction: 'ASC' },
375 url : baseURL + '/Builder/ERM.php'
380 totalProperty : 'total',
417 'name': 'displayorder',
425 'name': 'parent_image_id',
431 'dateFormat': 'Y-m-d'
458 'name': 'parent_image_id_id',
462 'name': 'parent_image_id_filename',
466 'name': 'parent_image_id_ontable',
470 'name': 'parent_image_id_onid',
474 'name': 'parent_image_id_mimetype',
478 'name': 'parent_image_id_width',
482 'name': 'parent_image_id_height',
486 'name': 'parent_image_id_filesize',
490 'name': 'parent_image_id_displayorder',
494 'name': 'parent_image_id_language',
498 'name': 'parent_image_id_parent_image_id',
502 'name': 'parent_image_id_created',
506 'name': 'parent_image_id_imgtype',
510 'name': 'parent_image_id_linkurl',
514 'name': 'parent_image_id_descript',
518 'name': 'parent_image_id_title',
522 'name': 'parent_image_id_credit',
526 'name': 'parent_image_id_source',
533 xtype: 'PagingToolbar',
537 displayMsg : "Displaying Images{0} - {1} of {2}",
538 emptyMsg : "No Images found"
550 Roo.MessageBox.alert("Updating", "Updating the cache");
552 url : baseURL + '/Core/RefreshDatabaseCache',
554 success : function() {
555 Roo.MessageBox.hide();
560 cls : 'x-btn-text-icon',
561 text : "Refresh Schema",
562 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
568 xtype: 'ColumnModel',
573 renderer : function(v) { return String.format('{0}', v); }
580 xtype: 'LayoutRegion',
586 xtype: 'LayoutRegion',