1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.AdminCoreEnum = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
34 title : "Pulldown Options",
41 activate : function() {
44 // _this.grid.footer.onClick('first');
52 tableName : 'core_enum',
53 title : "Pulldown Options",
61 //_this.dialog = Pman.Dialog.FILL_IN
62 if (_this.panel.active) {
63 // this.footer.onClick('first');
66 afteredit : function (e)
70 cellclick : function (_self, rowIndex, columnIndex, e)
73 var di = this.colModel.getDataIndex(columnIndex);
78 var rec = _this.grid.ds.getAt(rowIndex);
80 rec.set('active', rec.data.active ? 0 : 1);
85 beforeedit : function (e)
87 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
92 autoExpandColumn : 'display_name',
99 beforeload : function (_self, options)
102 options.params.etype = _this.data.etype;
103 if (!options.params.etype.length) {
107 update : function (_self, record, operation)
109 if (operation != Roo.data.Record.COMMIT) {
114 url : baseURL + '/Roo/Core_enum.php',
118 etype : _this.etypeCombo.getValue(),
119 name : record.data.name,
120 active : record.data.active,
121 seqid : record.data.seqid,
122 display_name : record.data.display_name
124 success : function(res) {
126 // update the ID if it's not set..
127 if (record.data.id * 1 < 1) {
128 record.set('id', res.data.id);
136 sortInfo : { field : 'etype', direction: 'ASC' },
141 url : baseURL + '/Roo/core_enum.php'
146 totalProperty : 'total',
174 xtype: 'PagingToolbar',
178 displayMsg : "Displaying core_enum{0} - {1} of {2}",
179 emptyMsg : "No core_enum found"
192 // if we do not have a selected type... - what should we show..?
193 var et = _this.data.etype;
194 var ds = _this.grid.getDataSource();
196 Roo.MessageBox.alert("Error", "Select a pulldown");
200 var add = ds.reader.newRow({
208 var r = ds.data.length;
210 _this.grid.startEditing(r, 1); // name...
213 cls : 'x-btn-text-icon',
215 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
225 xtype: 'ColumnModel',
228 header : 'Internal #',
230 renderer : function(v) { return String.format('{0}', v); }
233 xtype: 'ColumnModel',
238 renderer : function(v) { return String.format('{0}', v); },
249 xtype: 'ColumnModel',
251 dataIndex : 'display_name',
252 header : 'Display Name',
254 renderer : function(v) { return String.format('{0}', v); },
265 xtype: 'ColumnModel',
267 dataIndex : 'active',
270 renderer : function(v) {
271 var state = v> 0 ? '-checked' : '';
273 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
278 xtype: 'ColumnModel',
284 renderer : function(v) { return String.format('{0}', v); },
289 xtype: 'NumberField',
291 allowDecimals : false,
292 allowNegative : true,
302 xtype: 'LayoutRegion',
310 click : function (_self, e)