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 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
25 '49ee3087348e8d44e1feda1917443987' :"Name",
26 '7215ee9c7d9dc229d2921a40e899ec5f' :" "
29 part : ["Admin", "Enum" ],
30 order : '500-Pman.Tab.AdminEnum',
32 parent : 'Pman.Tab.Admin',
33 name : "Pman.Tab.AdminEnum",
47 xtype : 'LayoutRegion'
52 xtype : 'LayoutRegion'
56 xtype : 'BorderLayout',
64 url : baseURL + '/Roo/core_enum.php',
94 totalProperty : 'total',
100 sortInfo : { field : 'etype', direction: 'ASC' },
104 beforeload : function (_self, o)
106 o.params['query[empty_etype]'] = 1;
109 update : function (_self, record, operation)
111 if (operation != Roo.data.Record.COMMIT) {
116 url : baseURL + '/Roo/Core_enum.php',
120 etype : _this.grid.ds.getById(record.id).data.etype,
121 name : record.data.name,
122 active : record.data.active,
123 seqid : record.data.seqid,
124 display_name : record.data.display_name
126 success : function(res) {
128 // update the ID if it's not set..
129 if (record.data.id * 1 < 1) {
130 record.set('id', res.data.id);
145 xtype : 'CellSelectionModel',
147 selectionchange : function (_self, selection)
149 _this.grid.footer.onClick('first');
156 displayMsg : _this._strings['7215ee9c7d9dc229d2921a40e899ec5f'],
157 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'],
160 xtype : 'PagingToolbar'
168 '|xns' : 'Roo.Toolbar',
169 cls : 'x-btn-text-icon',
170 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
171 text : _this._strings['fdff10eac021dfbb69e9c38204237fdc'],
184 Pman.Dialog.AdminEnumType.show(data,function(){
186 _this.egrid.footer.onClick('first');
198 autoExpandColumn : 'display_name',
202 xtype : 'EditorGrid',
206 dataIndex : 'display_name',
207 header : _this._strings['1206eb8aea05be4625371c9c12818785'],
208 renderer : function(v,x,r) {
211 return String.format('<span qtip="{1}">{0}</span>', (''+v).length ? v : r.data.name, r.data.name);
215 xtype : 'ColumnModel'
219 dataIndex : 'active',
220 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
221 renderer : function(v) {
222 var state = v> 0 ? '-checked' : '';
224 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
229 xtype : 'ColumnModel'
233 afteredit : function (e)
237 beforeedit : function (e)
239 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
243 cellclick : function (_self, rowIndex, columnIndex, e)
246 var di = this.colModel.getDataIndex(columnIndex);
247 if (di != 'active') {
251 var rec = _this.grid.ds.getAt(rowIndex);
253 rec.set('active', rec.data.active ? 0 : 1);
258 celldblclick : function (_self, rowIndex, columnIndex, e)
260 var rec = _this.egrid.ds.getAt(rowIndex);
261 Pman.Dialog.AdminEnumType.show(rec.data,function(){
263 _this.egrid.footer.onClick('first');
269 //_this.dialog = Pman.Dialog.FILL_IN
270 if (_this.epanel.active) {
271 this.footer.onClick('first');
283 tableName : 'core_enum',
284 title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
288 activate : function() {
291 // _this.egrid.footer.onClick('first');
306 url : baseURL + '/Roo/core_enum.php',
336 totalProperty : 'total',
342 sortInfo : { field : 'etype', direction: 'ASC' },
346 beforeload : function (_self, options)
349 var s = _this.egrid.getSelectionModel().getSelectedCell();
355 var d = _this.egrid.dataSource.getAt(s[0]);
357 options.params.etype = d.data.name;
358 options.params['query[search]'] = _this.searchBox.getValue();
359 if (!options.params.etype.length) {
363 update : function (_self, record, operation)
365 if (operation != Roo.data.Record.COMMIT) {
370 url : baseURL + '/Roo/Core_enum.php',
374 etype : _this.grid.ds.getById(record.id).data.etype,
375 name : record.data.name,
376 active : record.data.active,
377 seqid : record.data.seqid,
378 display_name : record.data.display_name
380 success : function(res) {
382 // update the ID if it's not set..
383 if (record.data.id * 1 < 1) {
384 record.set('id', res.data.id);
399 displayMsg : _this._strings['510bc6e58593b2b8002c9fe0c21f3fde'],
400 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'],
403 xtype : 'PagingToolbar',
406 '|xns' : 'Roo.Toolbar',
407 text : _this._strings['801ab24683a4a8c433c6eb40c48bcd9d'],
411 click : function (_self, e)
416 Roo.MessageBox.alert("Downloading", "File is downloading");
421 '|xns' : 'Roo.Toolbar',
422 text : _this._strings['c550aeed26e71a81a88360c1889245ab'],
426 click : function (_self, e)
429 var s = _this.egrid.getSelectionModel().getSelectedCell();
433 Roo.MessageBox.alert("Error", "Select a pulldown");
436 var d = _this.egrid.dataSource.getAt(s[0]);
439 var etype = d.data.name;
442 Roo.MessageBox.alert('Error', 'Please select a pulldown');
446 Pman.Dialog.Image.show(
448 _url : baseURL+'/Admin/Import/Enum?' + Roo.urlEncode({'etype' : etype})
452 _this.grid.footer.onClick('first');
467 '|xns' : 'Roo.Toolbar',
468 cls : 'x-btn-text-icon',
469 icon : baseURL + '/Pman/templates/images/search.gif',
470 text : _this._strings['d9ec74f5aa29ceef6bf7b45f7fec5d0f'],
477 // if we do not have a selected type... - what should we show..?
480 var s = _this.egrid.getSelectionModel().getSelectedCell();
484 Roo.MessageBox.alert("Error", "Select a pulldown");
487 var d = _this.egrid.dataSource.getAt(s[0]);
490 var ds = _this.grid.getDataSource();
492 var add = ds.reader.newRow({
500 var r = ds.data.length;
503 _this.grid.startEditing(r, _this.grid.colModel.getIndexByDataIndex('name')); // name...
508 '|xns' : 'Roo.Toolbar',
509 cls : 'x-btn-text-icon',
510 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
511 text : _this._strings['b9c49611cfda3259a2b837b39489e650'],
518 // if we do not have a selected type... - what should we show..?
519 var et = _this.etypeCombo.getValue();
522 Roo.MessageBox.alert("Error", "Select a pulldown");
525 var sc = _this.grid.getSelectionModel().getSelectedCell();
527 var ds = _this.grid.ds.getAt(sc[0]);
529 Roo.MessageBox.alert("Error", "Select enum");
534 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
535 _this.grid.footer.onClick('first');
543 fieldLabel : 'Search',
548 render : function (_self)
550 _this.searchBox = this;
555 '|xns' : 'Roo.Toolbar',
557 icon : rootURL + '/Pman/templates/images/search.gif',
561 click : function (_self, e)
563 _this.grid.footer.onClick('first');
568 '|xns' : 'Roo.Toolbar',
570 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
574 click : function (_self, e)
576 _this.searchBox.setValue('');
577 _this.grid.footer.onClick('first');
582 '|xns' : 'Roo.Toolbar',
587 '|xns' : 'Roo.Toolbar',
588 cls : 'x-btn-text-icon',
589 icon : rootURL + '/Pman/templates/images/trash.gif',
590 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
597 _this.grid.dataSource.each(function(rr) {
599 ids.push(rr.data.id);
603 Roo.MessageBox.alert("Error", "Select rows by clicking on the Internal# column");
607 Roo.MessageBox.confirm(
609 "Confirm Deletion of selected rows (some rows can not be deleted if they are referenced elsewhere",
616 url : baseURL + '/Roo/Core_enum',
618 _delete : ids.join(',')
620 success : function() {
621 _this.grid.footer.onClick('refresh');
635 autoExpandColumn : 'display_name',
639 xtype : 'EditorGrid',
644 header : _this._strings['7af54708cf5a4286cf0cfa58ff5148a8'],
645 renderer : function(v,x,r) {
648 fmt = '<span style="color:orange;font-weight:bold;">{0}</span>';
650 return String.format(fmt, v); },
654 xtype : 'ColumnModel'
658 dataIndex : 'images_id_id',
659 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'],
660 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); },
663 xtype : 'ColumnModel'
674 xtype : 'GridEditor',
682 header : _this._strings['49ee3087348e8d44e1feda1917443987'],
683 renderer : function(v) { return String.format('{0}', v); },
687 xtype : 'ColumnModel',
702 xtype : 'GridEditor',
709 dataIndex : 'display_name',
710 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'],
711 renderer : function(v) { return String.format('{0}', v); },
715 xtype : 'ColumnModel',
723 dataIndex : 'active',
724 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
725 renderer : function(v) {
726 var state = v> 0 ? '-checked' : '';
728 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
734 xtype : 'ColumnModel'
740 allowDecimals : false,
741 allowNegative : true,
742 decimalPrecision : 0,
744 xtype : 'NumberField'
748 xtype : 'GridEditor',
756 header : _this._strings['d1228f5476d15142b1358ae4b5fa2454'],
757 renderer : function(v) { return String.format('{0}', v); },
762 xtype : 'ColumnModel',
770 afteredit : function (e)
774 beforeedit : function (e)
776 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
780 cellclick : function (_self, rowIndex, columnIndex, e)
783 var di = this.colModel.getDataIndex(columnIndex);
784 var rec = _this.grid.ds.getAt(rowIndex);
786 if (di == 'active') {
788 rec.set('active', rec.data.active ? 0 : 1);
794 if (!e.ctrlKey && !e.shiftKey) { // shift or control not pressed -clear selection.
796 this.dataSource.each(function(rr) {
802 if (this.last_selected && e.shiftKey) {
803 // the highlight all the lines between the one last selected, and this one.
804 var s = this.dataSource.indexOf(this.last_selected);
805 var e = this.dataSource.indexOf(rec);
806 var ss = Math.min(s,e);
807 var ee = Math.max(s,e) +1;
808 for(var i = ss; i < ee; i++) {
809 var rr = this.dataSource.getAt(i);
813 this.last_selected = rec;
818 rec.selected = rec.selected ? 0 : 1;
819 this.last_selected = rec.selected ? rec : false;
820 rec.set('sel', rec.data.sel ? 0 : 1);
827 keypress : function (e)
830 _this.grid.footer.onClick('first');
836 //_this.dialog = Pman.Dialog.FILL_IN
837 if (_this.panel.active) {
838 this.footer.onClick('first');
851 tableName : 'core_enum',
852 title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
856 activate : function() {
859 _this.grid.footer.onClick('first');
873 title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
875 xtype : 'NestedLayoutPanel',