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 options.params['query[search]'] = _this.searchBox.getValue();
365 if (!options.params.etype.length) {
378 xtype : 'PagingToolbar',
379 emptyMsg : "No core_enum found",
382 displayMsg : "Displaying core_enum{0} - {1} of {2}",
385 '|xns' : 'Roo.Toolbar',
390 click : function (_self, e)
395 Roo.MessageBox.alert("Downloading", "File is downloading");
400 '|xns' : 'Roo.Toolbar',
401 text : "Upload Values",
405 click : function (_self, e)
408 var s = _this.egrid.getSelectionModel().getSelectedCell();
412 Roo.MessageBox.alert("Error", "Select a pulldown");
415 var d = _this.egrid.dataSource.getAt(s[0]);
418 var etype = d.data.name;
421 Roo.MessageBox.alert('Error', 'Please select a pulldown');
425 Pman.Dialog.Image.show(
427 _url : baseURL+'/Admin/Import/Enum?' + Roo.urlEncode({'etype' : etype})
431 _this.grid.footer.onClick('first');
446 '|xns' : 'Roo.Toolbar',
449 cls : 'x-btn-text-icon',
450 icon : baseURL + '/Pman/templates/images/search.gif',
456 // if we do not have a selected type... - what should we show..?
459 var s = _this.egrid.getSelectionModel().getSelectedCell();
463 Roo.MessageBox.alert("Error", "Select a pulldown");
466 var d = _this.egrid.dataSource.getAt(s[0]);
469 var ds = _this.grid.getDataSource();
471 var add = ds.reader.newRow({
479 var r = ds.data.length;
481 _this.grid.startEditing(r, 1); // name...
486 '|xns' : 'Roo.Toolbar',
489 cls : 'x-btn-text-icon',
490 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
496 // if we do not have a selected type... - what should we show..?
497 var et = _this.etypeCombo.getValue();
500 Roo.MessageBox.alert("Error", "Select a pulldown");
503 var sc = _this.grid.getSelectionModel().getSelectedCell();
505 var ds = _this.grid.ds.getAt(sc[0]);
507 Roo.MessageBox.alert("Error", "Select enum");
512 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
513 _this.grid.footer.onClick('first');
523 fieldLabel : 'Search',
526 render : function (_self)
528 _this.searchBox = this;
533 '|xns' : 'Roo.Toolbar',
537 icon : rootURL + '/Pman/templates/images/search.gif',
539 click : function (_self, e)
541 _this.grid.footer.onClick('first');
546 '|xns' : 'Roo.Toolbar',
549 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
552 click : function (_self, e)
554 _this.searchBox.setValue('');
555 _this.grid.footer.onClick('first');
563 autoExpandColumn : 'display_name',
564 xtype : 'EditorGrid',
571 xtype : 'ColumnModel',
573 header : 'Internal #',
574 renderer : function(v) { return String.format('{0}', v); },
581 xtype : 'ColumnModel',
584 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); },
586 dataIndex : 'images_id_id'
596 xtype : 'GridEditor',
604 xtype : 'ColumnModel',
607 renderer : function(v) { return String.format('{0}', v); },
623 xtype : 'GridEditor',
631 xtype : 'ColumnModel',
633 header : 'Display Name',
634 renderer : function(v) { return String.format('{0}', v); },
636 dataIndex : 'display_name',
644 xtype : 'ColumnModel',
647 renderer : function(v) {
648 var state = v> 0 ? '-checked' : '';
650 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
660 allowNegative : true,
661 xtype : 'NumberField',
662 allowDecimals : false,
663 decimalPrecision : 0,
667 xtype : 'GridEditor',
675 xtype : 'ColumnModel',
679 renderer : function(v) { return String.format('{0}', v); },
689 beforeedit : function (e)
691 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
698 //_this.dialog = Pman.Dialog.FILL_IN
699 if (_this.panel.active) {
700 this.footer.onClick('first');
703 cellclick : function (_self, rowIndex, columnIndex, e)
706 var di = this.colModel.getDataIndex(columnIndex);
707 if (di != 'active') {
711 var rec = _this.grid.ds.getAt(rowIndex);
713 rec.set('active', rec.data.active ? 0 : 1);
718 afteredit : function (e)
732 title : "Pulldown Options",
735 tableName : 'core_enum',
737 activate : function() {
740 _this.grid.footer.onClick('first');
753 xtype : 'NestedLayoutPanel',
756 title : "Pulldown Options",