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)
105 // force fill in of name first.. (Except when it's hidden)
106 if (typeof(_this.data._hide_name) != 'undefined') {
107 if(e.field == 'display_name' && e.record.data.is_system_enum*1 == 1){
113 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
114 Roo.log("block name?");
119 autoExpandColumn : 'display_name',
126 beforeload : function (_self, options)
129 options.params.etype = _this.data.etype;
130 if (!options.params.etype.length) {
134 update : function (_self, record, operation)
136 if (operation != Roo.data.Record.COMMIT) {
141 if (typeof(_this.data._hide_name) != 'undefined') {
142 record.set('name', record.data.display_name);
144 if (!record.data.name.length) {
150 url : baseURL + '/Roo/Core_enum.php',
154 etype : _this.data.etype,
155 name : record.data.name,
156 active : record.data.active,
157 seqid : record.data.seqid,
158 display_name : record.data.display_name
160 success : function(res) {
162 // update the ID if it's not set..
163 if (record.data.id * 1 < 1) {
164 record.set('id', res.data.id);
172 sortInfo : { field : 'etype', direction: 'ASC' },
177 url : baseURL + '/Roo/core_enum.php'
182 totalProperty : 'total',
210 xtype: 'PagingToolbar',
214 displayMsg : "Displaying core_enum{0} - {1} of {2}",
215 emptyMsg : "No core_enum found"
228 // if we do not have a selected type... - what should we show..?
229 var et = _this.data.etype;
230 var ds = _this.grid.getDataSource();
232 Roo.MessageBox.alert("Error", "Select a pulldown");
236 var add = ds.reader.newRow({
244 var r = ds.data.length;
248 if (typeof(_this.data._hide_name) != 'undefined') {
251 _this.grid.startEditing(r, ec); // name...
254 cls : 'x-btn-text-icon',
256 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
266 xtype: 'ColumnModel',
269 header : 'Internal #',
271 renderer : function(v) { return String.format('{0}', v); }
274 xtype: 'ColumnModel',
279 renderer : function(v) { return String.format('{0}', v); },
290 xtype: 'ColumnModel',
292 dataIndex : 'display_name',
293 header : 'Display Name',
295 renderer : function(v) { return String.format('{0}', v); },
306 xtype: 'ColumnModel',
308 dataIndex : 'active',
311 renderer : function(v) {
312 var state = v> 0 ? '-checked' : '';
314 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
319 xtype: 'ColumnModel',
325 renderer : function(v) { return String.format('{0}', v); },
330 xtype: 'NumberField',
332 allowDecimals : false,
333 allowNegative : true,
343 xtype: 'LayoutRegion',
351 click : function (_self, e)
362 click : function (_self, e)
364 var sel = _this.grid.selModel.getSelectedCell();
365 if (!sel && _this.callback) {
366 Roo.MessageBox.alert("Error", "Select an item");
371 if (_this.callback) {
372 var rec = _this.grid.ds.getAt(sel[0]);
373 _this.callback(rec.data);