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)
101 if (!_this.etypeCombo) {
104 options.params.etype = _this.etypeCombo.getValue();
105 if (!options.params.etype.length) {
109 update : function (_self, record, operation)
111 if (operation != Roo.data.Record.COMMIT) {
116 url : baseURL + '/Roo/Core_enum.php',
120 etype : _this.etypeCombo.getValue(),
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);
138 sortInfo : { field : 'etype', direction: 'ASC' },
143 url : baseURL + '/Roo/core_enum.php'
148 totalProperty : 'total',
176 xtype: 'PagingToolbar',
180 displayMsg : "Displaying core_enum{0} - {1} of {2}",
181 emptyMsg : "No core_enum found"
194 // if we do not have a selected type... - what should we show..?
195 var et = _this.data.etype;
196 var ds = _this.grid.getDataSource();
198 Roo.MessageBox.alert("Error", "Select a pulldown");
202 var add = ds.reader.newRow({
210 var r = ds.data.length;
212 _this.grid.startEditing(r, 1); // name...
215 cls : 'x-btn-text-icon',
217 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
227 xtype: 'ColumnModel',
230 header : 'Internal #',
232 renderer : function(v) { return String.format('{0}', v); }
235 xtype: 'ColumnModel',
240 renderer : function(v) { return String.format('{0}', v); },
251 xtype: 'ColumnModel',
253 dataIndex : 'display_name',
254 header : 'Display Name',
256 renderer : function(v) { return String.format('{0}', v); },
267 xtype: 'ColumnModel',
269 dataIndex : 'active',
272 renderer : function(v) {
273 var state = v> 0 ? '-checked' : '';
275 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
280 xtype: 'ColumnModel',
286 renderer : function(v) { return String.format('{0}', v); },
291 xtype: 'NumberField',
293 allowDecimals : false,
294 allowNegative : true,
304 xtype: 'LayoutRegion',
312 click : function (_self, e)