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 show : function (_self)
36 var name_hidden = false;
38 if (typeof(_this.data._hide_name) != 'undefined') {
43 _this.grid.colModel.setHidden(1,name_hidden);
47 title : "Pulldown Options",
54 activate : function() {
57 // _this.grid.footer.onClick('first');
65 tableName : 'core_enum',
66 title : "Pulldown Options",
74 //_this.dialog = Pman.Dialog.FILL_IN
75 if (_this.panel.active) {
76 // this.footer.onClick('first');
79 afteredit : function (e)
83 cellclick : function (_self, rowIndex, columnIndex, e)
86 var di = this.colModel.getDataIndex(columnIndex);
91 var rec = _this.grid.ds.getAt(rowIndex);
93 rec.set('active', rec.data.active ? 0 : 1);
98 beforeedit : function (e)
100 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
105 autoExpandColumn : 'display_name',
112 beforeload : function (_self, options)
115 options.params.etype = _this.data.etype;
116 if (!options.params.etype.length) {
120 update : function (_self, record, operation)
122 if (operation != Roo.data.Record.COMMIT) {
126 var name = record.data.name;
127 if (typeof(_this.data._hide_name) != 'undefined') {
128 name = record.data.display_name;
132 url : baseURL + '/Roo/Core_enum.php',
136 etype : _this.data.etype,
137 name : record.data.name,
138 active : record.data.active,
139 seqid : record.data.seqid,
140 display_name : record.data.display_name
142 success : function(res) {
144 // update the ID if it's not set..
145 if (record.data.id * 1 < 1) {
146 record.set('id', res.data.id);
154 sortInfo : { field : 'etype', direction: 'ASC' },
159 url : baseURL + '/Roo/core_enum.php'
164 totalProperty : 'total',
192 xtype: 'PagingToolbar',
196 displayMsg : "Displaying core_enum{0} - {1} of {2}",
197 emptyMsg : "No core_enum found"
210 // if we do not have a selected type... - what should we show..?
211 var et = _this.data.etype;
212 var ds = _this.grid.getDataSource();
214 Roo.MessageBox.alert("Error", "Select a pulldown");
218 var add = ds.reader.newRow({
226 var r = ds.data.length;
228 _this.grid.startEditing(r, 1); // name...
231 cls : 'x-btn-text-icon',
233 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
243 xtype: 'ColumnModel',
246 header : 'Internal #',
248 renderer : function(v) { return String.format('{0}', v); }
251 xtype: 'ColumnModel',
256 renderer : function(v) { return String.format('{0}', v); },
267 xtype: 'ColumnModel',
269 dataIndex : 'display_name',
270 header : 'Display Name',
272 renderer : function(v) { return String.format('{0}', v); },
283 xtype: 'ColumnModel',
285 dataIndex : 'active',
288 renderer : function(v) {
289 var state = v> 0 ? '-checked' : '';
291 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
296 xtype: 'ColumnModel',
302 renderer : function(v) { return String.format('{0}', v); },
307 xtype: 'NumberField',
309 allowDecimals : false,
310 allowNegative : true,
320 xtype: 'LayoutRegion',
328 click : function (_self, e)