1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.AdminEnum = new Roo.XComponent({
8 part : ["Admin", "Enum" ],
9 order : '500-Pman.Tab.AdminEnum',
11 parent : 'Pman.Tab.Admin',
12 name : "Pman.Tab.AdminEnum",
24 xtype : 'LayoutRegion',
30 xtype : 'LayoutRegion',
34 xtype : 'BorderLayout',
42 url : baseURL + '/Roo/core_enum.php',
75 totalProperty : 'total'
80 sortInfo : { field : 'etype', direction: 'ASC' },
83 update : function (_self, record, operation)
85 if (operation != Roo.data.Record.COMMIT) {
90 url : baseURL + '/Roo/Core_enum.php',
94 etype : _this.grid.ds.getById(record.id).data.etype,
95 name : record.data.name,
96 active : record.data.active,
97 seqid : record.data.seqid,
98 display_name : record.data.display_name
100 success : function(res) {
102 // update the ID if it's not set..
103 if (record.data.id * 1 < 1) {
104 record.set('id', res.data.id);
110 beforeload : function (_self, o)
112 o.params['query[empty_etype]'] = 1;
123 xtype : 'CellSelectionModel',
126 selectionchange : function (_self, selection)
128 _this.grid.footer.onClick('first');
135 xtype : 'PagingToolbar',
136 emptyMsg : "No core_enum found",
147 '|xns' : 'Roo.Toolbar',
148 text : "Add new pulldown list",
150 cls : 'x-btn-text-icon',
151 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
163 Pman.Dialog.AdminEnumType.show(data,function(){
165 _this.egrid.footer.onClick('first');
177 autoExpandColumn : 'display_name',
178 xtype : 'EditorGrid',
185 xtype : 'ColumnModel',
188 renderer : function(v,x,r) {
191 return String.format('<span qtip="{1}">{0}</span>', (''+v).length ? v : r.data.name, r.data.name);
194 dataIndex : 'display_name'
198 xtype : 'ColumnModel',
201 renderer : function(v) {
202 var state = v> 0 ? '-checked' : '';
204 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
212 beforeedit : function (e)
214 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
218 cellclick : function (_self, rowIndex, columnIndex, e)
221 var di = this.colModel.getDataIndex(columnIndex);
222 if (di != 'active') {
226 var rec = _this.grid.ds.getAt(rowIndex);
228 rec.set('active', rec.data.active ? 0 : 1);
236 //_this.dialog = Pman.Dialog.FILL_IN
237 if (_this.epanel.active) {
238 this.footer.onClick('first');
241 celldblclick : function (_self, rowIndex, columnIndex, e)
243 var rec = _this.egrid.ds.getAt(rowIndex);
244 Pman.Dialog.AdminEnumType.show(rec.data,function(){
246 _this.egrid.footer.onClick('first');
249 afteredit : function (e)
262 title : "Pulldown Options",
265 tableName : 'core_enum',
267 activate : function() {
270 _this.egrid.footer.onClick('first');
284 url : baseURL + '/Roo/core_enum.php',
293 xtype : 'JsonReader',
317 totalProperty : 'total'
322 sortInfo : { field : 'etype', direction: 'ASC' },
325 update : function (_self, record, operation)
327 if (operation != Roo.data.Record.COMMIT) {
332 url : baseURL + '/Roo/Core_enum.php',
336 etype : _this.grid.ds.getById(record.id).data.etype,
337 name : record.data.name,
338 active : record.data.active,
339 seqid : record.data.seqid,
340 display_name : record.data.display_name
342 success : function(res) {
344 // update the ID if it's not set..
345 if (record.data.id * 1 < 1) {
346 record.set('id', res.data.id);
352 beforeload : function (_self, options)
355 var s = _this.egrid.getSelectionModel().getSelectedCell();
361 var d = _this.egrid.dataSource.getAt(s[0]);
363 options.params.etype = d.data.name;
364 if (!options.params.etype.length) {
377 xtype : 'PagingToolbar',
378 emptyMsg : "No core_enum found",
381 displayMsg : "Displaying core_enum{0} - {1} of {2}",
384 '|xns' : 'Roo.Toolbar',
389 click : function (_self, e)
394 Roo.MessageBox.alert("Downloading", "File is downloading");
399 '|xns' : 'Roo.Toolbar',
400 text : "Upload Values",
404 click : function (_self, e)
407 var s = _this.egrid.getSelectionModel().getSelectedCell();
411 Roo.MessageBox.alert("Error", "Select a pulldown");
414 var d = _this.egrid.dataSource.getAt(s[0]);
417 var etype = d.data.name;
420 Roo.MessageBox.alert('Error', 'Please select a pulldown');
424 Pman.Dialog.Image.show(
426 _url : baseURL+'/Admin/Import/Enum?' + Roo.urlEncode({'etype' : etype})
430 _this.grid.footer.onClick('first');
445 '|xns' : 'Roo.Toolbar',
448 cls : 'x-btn-text-icon',
449 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
455 // if we do not have a selected type... - what should we show..?
458 var s = _this.egrid.getSelectionModel().getSelectedCell();
462 Roo.MessageBox.alert("Error", "Select a pulldown");
465 var d = _this.egrid.dataSource.getAt(s[0]);
468 var ds = _this.grid.getDataSource();
470 var add = ds.reader.newRow({
478 var r = ds.data.length;
480 _this.grid.startEditing(r, 1); // name...
485 '|xns' : 'Roo.Toolbar',
488 cls : 'x-btn-text-icon',
489 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
495 // if we do not have a selected type... - what should we show..?
496 var et = _this.etypeCombo.getValue();
499 Roo.MessageBox.alert("Error", "Select a pulldown");
502 var sc = _this.grid.getSelectionModel().getSelectedCell();
504 var ds = _this.grid.ds.getAt(sc[0]);
506 Roo.MessageBox.alert("Error", "Select enum");
511 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
512 _this.grid.footer.onClick('first');
522 fieldLabel : 'Search',
526 '|xns' : 'Roo.Toolbar',
529 icon : 'rootURL + \'/Pman/templates/images/search.gif\''
532 '|xns' : 'Roo.Toolbar',
535 icon : 'http://roojs.com/Pman/templates/images/edit-clear.gif'
541 autoExpandColumn : 'display_name',
542 xtype : 'EditorGrid',
549 xtype : 'ColumnModel',
551 header : 'Internal #',
552 renderer : function(v) { return String.format('{0}', v); },
558 xtype : 'ColumnModel',
561 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/25/{1}/{2}" width="25" height="25">', baseURL, v, r.data.images_id_filename); },
563 dataIndex : 'images_id_id'
573 xtype : 'GridEditor',
581 xtype : 'ColumnModel',
584 renderer : function(v) { return String.format('{0}', v); },
600 xtype : 'GridEditor',
608 xtype : 'ColumnModel',
610 header : 'Display Name',
611 renderer : function(v) { return String.format('{0}', v); },
613 dataIndex : 'display_name',
621 xtype : 'ColumnModel',
624 renderer : function(v) {
625 var state = v> 0 ? '-checked' : '';
627 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
637 allowNegative : true,
638 xtype : 'NumberField',
639 allowDecimals : false,
640 decimalPrecision : 0,
644 xtype : 'GridEditor',
652 xtype : 'ColumnModel',
656 renderer : function(v) { return String.format('{0}', v); },
666 beforeedit : function (e)
668 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
675 //_this.dialog = Pman.Dialog.FILL_IN
676 if (_this.panel.active) {
677 this.footer.onClick('first');
680 cellclick : function (_self, rowIndex, columnIndex, e)
683 var di = this.colModel.getDataIndex(columnIndex);
684 if (di != 'active') {
688 var rec = _this.grid.ds.getAt(rowIndex);
690 rec.set('active', rec.data.active ? 0 : 1);
695 afteredit : function (e)
709 title : "Pulldown Options",
712 tableName : 'core_enum',
714 activate : function() {
717 _this.grid.footer.onClick('first');
730 xtype : 'NestedLayoutPanel',
733 title : "Pulldown Options",