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',
157 Roo.MessageBox.prompt ("Create a new Enum type",
158 "Enter the name for a new enum type, " +
159 "this is only relivant if you know how it is going to be used",
165 url : baseURL + '/Roo/Core_enum.php',
172 success : function() {
173 Roo.MessageBox.alert("Created", "You can now select it from the type list on the left");
192 autoExpandColumn : 'display_name',
193 xtype : 'EditorGrid',
200 xtype : 'ColumnModel',
203 renderer : function(v,x,r) {
206 return String.format('<span qtip="{1}">{0}</span>', (''+v).length ? v : r.data.name, r.data.name);
209 dataIndex : 'display_name'
213 xtype : 'ColumnModel',
216 renderer : function(v) {
217 var state = v> 0 ? '-checked' : '';
219 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
227 beforeedit : function (e)
229 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
233 cellclick : function (_self, rowIndex, columnIndex, e)
236 var di = this.colModel.getDataIndex(columnIndex);
237 if (di != 'active') {
241 var rec = _this.grid.ds.getAt(rowIndex);
243 rec.set('active', rec.data.active ? 0 : 1);
251 //_this.dialog = Pman.Dialog.FILL_IN
252 if (_this.epanel.active) {
253 this.footer.onClick('first');
256 celldblclick : function (_self, rowIndex, columnIndex, e)
258 var rec = _this.egrid.ds.getAt(rowIndex);
259 Pman.Dialog.AdminEnumType.show(rec.data,function(){
261 _this.egrid.footer.onClick('first');
264 afteredit : function (e)
277 title : "Pulldown Options",
280 tableName : 'core_enum',
282 activate : function() {
285 _this.egrid.footer.onClick('first');
299 url : baseURL + '/Roo/core_enum.php',
308 xtype : 'JsonReader',
332 totalProperty : 'total'
337 sortInfo : { field : 'etype', direction: 'ASC' },
340 update : function (_self, record, operation)
342 if (operation != Roo.data.Record.COMMIT) {
347 url : baseURL + '/Roo/Core_enum.php',
351 etype : _this.grid.ds.getById(record.id).data.etype,
352 name : record.data.name,
353 active : record.data.active,
354 seqid : record.data.seqid,
355 display_name : record.data.display_name
357 success : function(res) {
359 // update the ID if it's not set..
360 if (record.data.id * 1 < 1) {
361 record.set('id', res.data.id);
367 beforeload : function (_self, options)
370 var s = _this.egrid.getSelectionModel().getSelectedCell();
376 var d = _this.egrid.dataSource.getAt(s[0]);
378 options.params.etype = d.data.name;
379 if (!options.params.etype.length) {
392 xtype : 'PagingToolbar',
393 emptyMsg : "No core_enum found",
396 displayMsg : "Displaying core_enum{0} - {1} of {2}",
399 '|xns' : 'Roo.Toolbar',
404 click : function (_self, e)
409 Roo.MessageBox.alert("Downloading", "File is downloading");
414 '|xns' : 'Roo.Toolbar',
415 text : "Upload Value",
419 click : function (_self, e)
422 var s = _this.egrid.getSelectionModel().getSelectedCell();
426 Roo.MessageBox.alert("Error", "Select a pulldown");
429 var d = _this.egrid.dataSource.getAt(s[0]);
432 var etype = d.data.name;
435 Roo.MessageBox.alert('Error', 'Please select a pulldown');
439 Pman.Dialog.Image.show(
441 _url : baseURL+'/Xtuple/Import/Enum?' + Roo.urlEncode({'etype' : etype})
445 _this.grid.footer.onClick('first');
460 '|xns' : 'Roo.Toolbar',
463 cls : 'x-btn-text-icon',
464 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
470 // if we do not have a selected type... - what should we show..?
473 var s = _this.egrid.getSelectionModel().getSelectedCell();
477 Roo.MessageBox.alert("Error", "Select a pulldown");
480 var d = _this.egrid.dataSource.getAt(s[0]);
483 var ds = _this.grid.getDataSource();
485 var add = ds.reader.newRow({
493 var r = ds.data.length;
495 _this.grid.startEditing(r, 1); // name...
500 '|xns' : 'Roo.Toolbar',
503 cls : 'x-btn-text-icon',
504 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
510 // if we do not have a selected type... - what should we show..?
511 var et = _this.etypeCombo.getValue();
514 Roo.MessageBox.alert("Error", "Select a pulldown");
517 var sc = _this.grid.getSelectionModel().getSelectedCell();
519 var ds = _this.grid.ds.getAt(sc[0]);
521 Roo.MessageBox.alert("Error", "Select enum");
526 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
527 _this.grid.footer.onClick('first');
537 autoExpandColumn : 'display_name',
538 xtype : 'EditorGrid',
545 xtype : 'ColumnModel',
547 header : 'Internal #',
548 renderer : function(v) { return String.format('{0}', v); },
554 xtype : 'ColumnModel',
557 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); },
559 dataIndex : 'images_id_id'
569 xtype : 'GridEditor',
577 xtype : 'ColumnModel',
580 renderer : function(v) { return String.format('{0}', v); },
596 xtype : 'GridEditor',
604 xtype : 'ColumnModel',
606 header : 'Display Name',
607 renderer : function(v) { return String.format('{0}', v); },
609 dataIndex : 'display_name',
617 xtype : 'ColumnModel',
620 renderer : function(v) {
621 var state = v> 0 ? '-checked' : '';
623 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
633 allowNegative : true,
634 xtype : 'NumberField',
635 allowDecimals : false,
636 decimalPrecision : 0,
640 xtype : 'GridEditor',
648 xtype : 'ColumnModel',
652 renderer : function(v) { return String.format('{0}', v); },
662 beforeedit : function (e)
664 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
671 //_this.dialog = Pman.Dialog.FILL_IN
672 if (_this.panel.active) {
673 this.footer.onClick('first');
676 cellclick : function (_self, rowIndex, columnIndex, e)
679 var di = this.colModel.getDataIndex(columnIndex);
680 if (di != 'active') {
684 var rec = _this.grid.ds.getAt(rowIndex);
686 rec.set('active', rec.data.active ? 0 : 1);
691 afteredit : function (e)
705 title : "Pulldown Options",
708 tableName : 'core_enum',
710 activate : function() {
713 _this.grid.footer.onClick('first');
726 xtype : 'NestedLayoutPanel',
729 title : "Pulldown Options",