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);
44 _this.grid.footer.onClick('first');
51 title : "Pulldown Options",
58 activate : function() {
61 // _this.grid.footer.onClick('first');
69 tableName : 'core_enum',
70 title : "Pulldown Options",
78 //_this.dialog = Pman.Dialog.FILL_IN
79 if (_this.panel.active) {
80 // this.footer.onClick('first');
83 afteredit : function (e)
87 cellclick : function (_self, rowIndex, columnIndex, e)
90 var di = this.colModel.getDataIndex(columnIndex);
95 var rec = _this.grid.ds.getAt(rowIndex);
97 rec.set('active', rec.data.active ? 0 : 1);
102 beforeedit : function (e)
104 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
109 autoExpandColumn : 'display_name',
116 beforeload : function (_self, options)
119 options.params.etype = _this.data.etype;
120 if (!options.params.etype.length) {
124 update : function (_self, record, operation)
126 if (operation != Roo.data.Record.COMMIT) {
131 if (typeof(_this.data._hide_name) != 'undefined') {
132 record.set('name', record.data.display_name);
134 if (!record.data.name.length) {
140 url : baseURL + '/Roo/Core_enum.php',
144 etype : _this.data.etype,
145 name : record.data.name,
146 active : record.data.active,
147 seqid : record.data.seqid,
148 display_name : record.data.display_name
150 success : function(res) {
152 // update the ID if it's not set..
153 if (record.data.id * 1 < 1) {
154 record.set('id', res.data.id);
162 sortInfo : { field : 'etype', direction: 'ASC' },
167 url : baseURL + '/Roo/core_enum.php'
172 totalProperty : 'total',
200 xtype: 'PagingToolbar',
204 displayMsg : "Displaying core_enum{0} - {1} of {2}",
205 emptyMsg : "No core_enum found"
218 // if we do not have a selected type... - what should we show..?
219 var et = _this.data.etype;
220 var ds = _this.grid.getDataSource();
222 Roo.MessageBox.alert("Error", "Select a pulldown");
226 var add = ds.reader.newRow({
234 var r = ds.data.length;
236 _this.grid.startEditing(r, 1); // name...
239 cls : 'x-btn-text-icon',
241 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
251 xtype: 'ColumnModel',
254 header : 'Internal #',
256 renderer : function(v) { return String.format('{0}', v); }
259 xtype: 'ColumnModel',
264 renderer : function(v) { return String.format('{0}', v); },
275 xtype: 'ColumnModel',
277 dataIndex : 'display_name',
278 header : 'Display Name',
280 renderer : function(v) { return String.format('{0}', v); },
291 xtype: 'ColumnModel',
293 dataIndex : 'active',
296 renderer : function(v) {
297 var state = v> 0 ? '-checked' : '';
299 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
304 xtype: 'ColumnModel',
310 renderer : function(v) { return String.format('{0}', v); },
315 xtype: 'NumberField',
317 allowDecimals : false,
318 allowNegative : true,
328 xtype: 'LayoutRegion',
336 click : function (_self, e)
347 click : function (_self, e)
349 var sel = _this.grid.selModel.getSelectedCell();
350 if (!sel && _this.callback) {
351 Roo.MessageBox.alert("Error", "Select an item");
356 if (_this.callback) {
357 var rec = _this.grid.ds.getAt(sel[0]);
358 _this.callback(rec.data);