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)
85 // (function() { e.record.commit(); }).defer(100);
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 Roo.log('before edit?');
106 // force fill in of name first.. (Except when it's hidden)
107 if (typeof(_this.data._hide_name) != 'undefined') {
108 if(e.field == 'display_name' && e.record.data.is_system_enum*1 == 1){
114 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
115 Roo.log("block name?");
120 autoExpandColumn : 'display_name',
127 beforeload : function (_self, options)
130 options.params.etype = _this.data.etype;
131 if (!options.params.etype.length) {
135 update : function (_self, record, operation)
137 if (operation != Roo.data.Record.COMMIT) {
142 if (typeof(_this.data._hide_name) != 'undefined') {
143 record.set('name', record.data.display_name);
145 if (!record.data.name.length) {
151 url : baseURL + '/Roo/Core_enum.php',
155 etype : _this.data.etype,
156 name : record.data.name,
157 active : record.data.active,
158 seqid : record.data.seqid,
159 display_name : record.data.display_name
161 success : function(res) {
163 // update the ID if it's not set..
164 if (record.data.id * 1 < 1) {
165 record.set('id', res.data.id);
173 sortInfo : { field : 'etype', direction: 'ASC' },
178 url : baseURL + '/Roo/core_enum.php'
183 totalProperty : 'total',
211 xtype: 'PagingToolbar',
215 displayMsg : "Displaying core_enum{0} - {1} of {2}",
216 emptyMsg : "No core_enum found"
229 // if we do not have a selected type... - what should we show..?
230 var et = _this.data.etype;
231 var ds = _this.grid.getDataSource();
233 Roo.MessageBox.alert("Error", "Select a pulldown");
237 var add = ds.reader.newRow({
245 var r = ds.data.length;
250 _this.grid.startEditing(r, 1); // name...
253 cls : 'x-btn-text-icon',
255 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
265 xtype: 'ColumnModel',
268 header : 'Internal #',
270 renderer : function(v) { return String.format('{0}', v); }
273 xtype: 'ColumnModel',
278 renderer : function(v) { return String.format('{0}', v); },
289 xtype: 'ColumnModel',
291 dataIndex : 'display_name',
292 header : 'Display Name',
294 renderer : function(v) { return String.format('{0}', v); },
305 xtype: 'ColumnModel',
307 dataIndex : 'active',
310 renderer : function(v) {
311 var state = v> 0 ? '-checked' : '';
313 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
318 xtype: 'ColumnModel',
324 renderer : function(v) { return String.format('{0}', v); },
329 xtype: 'NumberField',
331 allowDecimals : false,
332 allowNegative : true,
342 xtype: 'LayoutRegion',
350 click : function (_self, e)
361 click : function (_self, e)
363 var sel = _this.grid.selModel.getSelectedCell();
364 if (!sel && _this.callback) {
365 Roo.MessageBox.alert("Error", "Select an item");
370 if (_this.callback) {
371 var rec = _this.grid.ds.getAt(sel[0]);
372 _this.callback(rec.data);