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({
10 '2df80d5febcde0c10a66818488622b7c' :"Pulldown Options",
11 'd1228f5476d15142b1358ae4b5fa2454' :"Order #",
12 'fdff10eac021dfbb69e9c38204237fdc' :"Add new pulldown list",
13 '1206eb8aea05be4625371c9c12818785' :"Pulldown",
14 '801ab24683a4a8c433c6eb40c48bcd9d' :"Download",
15 '7af54708cf5a4286cf0cfa58ff5148a8' :"Internal #",
16 'be53a0541a6d36f6ecb879fa2c584b08' :"Image",
17 'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
18 '510bc6e58593b2b8002c9fe0c21f3fde' :"Displaying core_enum{0} - {1} of {2}",
19 '1ba4d808fc7b27a7f60ce2ff75a8af3a' :"No core_enum found",
20 'c550aeed26e71a81a88360c1889245ab' :"Upload Values",
21 'd9ec74f5aa29ceef6bf7b45f7fec5d0f' :"Add Value",
22 'b9c49611cfda3259a2b837b39489e650' :"Add Image",
23 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
24 '49ee3087348e8d44e1feda1917443987' :"Name",
25 '7215ee9c7d9dc229d2921a40e899ec5f' :" "
28 part : ["Admin", "Enum" ],
29 order : '500-Pman.Tab.AdminEnum',
31 parent : 'Pman.Tab.Admin',
32 name : "Pman.Tab.AdminEnum",
46 xtype : 'LayoutRegion'
51 xtype : 'LayoutRegion'
55 xtype : 'BorderLayout',
63 url : baseURL + '/Roo/core_enum.php',
93 totalProperty : 'total',
99 sortInfo : { field : 'etype', direction: 'ASC' },
103 beforeload : function (_self, o)
105 o.params['query[empty_etype]'] = 1;
108 update : function (_self, record, operation)
110 if (operation != Roo.data.Record.COMMIT) {
115 url : baseURL + '/Roo/Core_enum.php',
119 etype : _this.grid.ds.getById(record.id).data.etype,
120 name : record.data.name,
121 active : record.data.active,
122 seqid : record.data.seqid,
123 display_name : record.data.display_name
125 success : function(res) {
127 // update the ID if it's not set..
128 if (record.data.id * 1 < 1) {
129 record.set('id', res.data.id);
144 xtype : 'CellSelectionModel',
146 selectionchange : function (_self, selection)
148 _this.grid.footer.onClick('first');
155 displayMsg : _this._strings['7215ee9c7d9dc229d2921a40e899ec5f'],
156 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'],
159 xtype : 'PagingToolbar'
167 '|xns' : 'Roo.Toolbar',
168 cls : 'x-btn-text-icon',
169 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
170 text : _this._strings['fdff10eac021dfbb69e9c38204237fdc'],
183 Pman.Dialog.AdminEnumType.show(data,function(){
185 _this.egrid.footer.onClick('first');
197 autoExpandColumn : 'display_name',
201 xtype : 'EditorGrid',
205 dataIndex : 'display_name',
206 header : _this._strings['1206eb8aea05be4625371c9c12818785'],
207 renderer : function(v,x,r) {
210 return String.format('<span qtip="{1}">{0}</span>', (''+v).length ? v : r.data.name, r.data.name);
214 xtype : 'ColumnModel'
218 dataIndex : 'active',
219 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
220 renderer : function(v) {
221 var state = v> 0 ? '-checked' : '';
223 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
228 xtype : 'ColumnModel'
232 afteredit : function (e)
236 beforeedit : function (e)
238 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
242 cellclick : function (_self, rowIndex, columnIndex, e)
245 var di = this.colModel.getDataIndex(columnIndex);
246 if (di != 'active') {
250 var rec = _this.grid.ds.getAt(rowIndex);
252 rec.set('active', rec.data.active ? 0 : 1);
257 celldblclick : function (_self, rowIndex, columnIndex, e)
259 var rec = _this.egrid.ds.getAt(rowIndex);
260 Pman.Dialog.AdminEnumType.show(rec.data,function(){
262 _this.egrid.footer.onClick('first');
268 //_this.dialog = Pman.Dialog.FILL_IN
269 if (_this.epanel.active) {
270 this.footer.onClick('first');
282 tableName : 'core_enum',
283 title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
287 activate : function() {
290 // _this.egrid.footer.onClick('first');
305 url : baseURL + '/Roo/core_enum.php',
335 totalProperty : 'total',
341 sortInfo : { field : 'etype', direction: 'ASC' },
345 beforeload : function (_self, options)
348 var s = _this.egrid.getSelectionModel().getSelectedCell();
354 var d = _this.egrid.dataSource.getAt(s[0]);
356 options.params.etype = d.data.name;
357 options.params['query[search]'] = _this.searchBox.getValue();
358 if (!options.params.etype.length) {
362 update : function (_self, record, operation)
364 if (operation != Roo.data.Record.COMMIT) {
369 url : baseURL + '/Roo/Core_enum.php',
373 etype : _this.grid.ds.getById(record.id).data.etype,
374 name : record.data.name,
375 active : record.data.active,
376 seqid : record.data.seqid,
377 display_name : record.data.display_name
379 success : function(res) {
381 // update the ID if it's not set..
382 if (record.data.id * 1 < 1) {
383 record.set('id', res.data.id);
398 displayMsg : _this._strings['510bc6e58593b2b8002c9fe0c21f3fde'],
399 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'],
402 xtype : 'PagingToolbar',
405 '|xns' : 'Roo.Toolbar',
406 text : _this._strings['801ab24683a4a8c433c6eb40c48bcd9d'],
410 click : function (_self, e)
415 Roo.MessageBox.alert("Downloading", "File is downloading");
420 '|xns' : 'Roo.Toolbar',
421 text : _this._strings['c550aeed26e71a81a88360c1889245ab'],
425 click : function (_self, e)
428 var s = _this.egrid.getSelectionModel().getSelectedCell();
432 Roo.MessageBox.alert("Error", "Select a pulldown");
435 var d = _this.egrid.dataSource.getAt(s[0]);
438 var etype = d.data.name;
441 Roo.MessageBox.alert('Error', 'Please select a pulldown');
445 Pman.Dialog.Image.show(
447 _url : baseURL+'/Admin/Import/Enum?' + Roo.urlEncode({'etype' : etype})
451 _this.grid.footer.onClick('first');
466 '|xns' : 'Roo.Toolbar',
467 cls : 'x-btn-text-icon',
468 icon : baseURL + '/Pman/templates/images/search.gif',
469 text : _this._strings['d9ec74f5aa29ceef6bf7b45f7fec5d0f'],
476 // if we do not have a selected type... - what should we show..?
479 var s = _this.egrid.getSelectionModel().getSelectedCell();
483 Roo.MessageBox.alert("Error", "Select a pulldown");
486 var d = _this.egrid.dataSource.getAt(s[0]);
489 var ds = _this.grid.getDataSource();
491 var add = ds.reader.newRow({
499 var r = ds.data.length;
501 _this.grid.startEditing(r, 1); // name...
506 '|xns' : 'Roo.Toolbar',
507 cls : 'x-btn-text-icon',
508 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
509 text : _this._strings['b9c49611cfda3259a2b837b39489e650'],
516 // if we do not have a selected type... - what should we show..?
517 var et = _this.etypeCombo.getValue();
520 Roo.MessageBox.alert("Error", "Select a pulldown");
523 var sc = _this.grid.getSelectionModel().getSelectedCell();
525 var ds = _this.grid.ds.getAt(sc[0]);
527 Roo.MessageBox.alert("Error", "Select enum");
532 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
533 _this.grid.footer.onClick('first');
541 fieldLabel : 'Search',
546 render : function (_self)
548 _this.searchBox = this;
553 '|xns' : 'Roo.Toolbar',
555 icon : rootURL + '/Pman/templates/images/search.gif',
559 click : function (_self, e)
561 _this.grid.footer.onClick('first');
566 '|xns' : 'Roo.Toolbar',
568 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
572 click : function (_self, e)
574 _this.searchBox.setValue('');
575 _this.grid.footer.onClick('first');
583 autoExpandColumn : 'display_name',
587 xtype : 'EditorGrid',
592 header : _this._strings['7af54708cf5a4286cf0cfa58ff5148a8'],
593 renderer : function(v,x,r) {
596 fmt = '<span style="color:orange;font-weight:bold;">{0}</span>';
598 return String.format(fmt, v); },
602 xtype : 'ColumnModel'
606 dataIndex : 'images_id_id',
607 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'],
608 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); },
611 xtype : 'ColumnModel'
622 xtype : 'GridEditor',
630 header : _this._strings['49ee3087348e8d44e1feda1917443987'],
631 renderer : function(v) { return String.format('{0}', v); },
635 xtype : 'ColumnModel',
650 xtype : 'GridEditor',
657 dataIndex : 'display_name',
658 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'],
659 renderer : function(v) { return String.format('{0}', v); },
663 xtype : 'ColumnModel',
671 dataIndex : 'active',
672 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
673 renderer : function(v) {
674 var state = v> 0 ? '-checked' : '';
676 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
682 xtype : 'ColumnModel'
688 allowDecimals : false,
689 allowNegative : true,
690 decimalPrecision : 0,
692 xtype : 'NumberField'
696 xtype : 'GridEditor',
704 header : _this._strings['d1228f5476d15142b1358ae4b5fa2454'],
705 renderer : function(v) { return String.format('{0}', v); },
710 xtype : 'ColumnModel',
718 afteredit : function (e)
722 beforeedit : function (e)
724 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
728 cellclick : function (_self, rowIndex, columnIndex, e)
731 var di = this.colModel.getDataIndex(columnIndex);
732 var rec = _this.grid.ds.getAt(rowIndex);
734 if (di == 'active') {
736 rec.set('active', rec.data.active ? 0 : 1);
741 rec.selected = rec.selected ? 0 : 1;
743 rec.set('sel', rec.data.sel ? 0 : 1);
750 keypress : function (e)
753 _this.grid.footer.onClick('first');
759 //_this.dialog = Pman.Dialog.FILL_IN
760 if (_this.panel.active) {
761 this.footer.onClick('first');
774 tableName : 'core_enum',
775 title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
779 activate : function() {
782 _this.grid.footer.onClick('first');
796 title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
798 xtype : 'NestedLayoutPanel',