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)
105 // force fill in of name first..
106 if (typeof(_this.data._hide_name) != 'undefined') {
107 if(e.field == 'display_name' && e.record.data.is_system_enum*1 == 1){
112 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
117 autoExpandColumn : 'display_name',
124 beforeload : function (_self, options)
127 options.params.etype = _this.data.etype;
128 if (!options.params.etype.length) {
132 update : function (_self, record, operation)
134 if (operation != Roo.data.Record.COMMIT) {
139 if (typeof(_this.data._hide_name) != 'undefined') {
140 record.set('name', record.data.display_name);
142 if (!record.data.name.length) {
148 url : baseURL + '/Roo/Core_enum.php',
152 etype : _this.data.etype,
153 name : record.data.name,
154 active : record.data.active,
155 seqid : record.data.seqid,
156 display_name : record.data.display_name
158 success : function(res) {
160 // update the ID if it's not set..
161 if (record.data.id * 1 < 1) {
162 record.set('id', res.data.id);
170 sortInfo : { field : 'etype', direction: 'ASC' },
175 url : baseURL + '/Roo/core_enum.php'
180 totalProperty : 'total',
208 xtype: 'PagingToolbar',
212 displayMsg : "Displaying core_enum{0} - {1} of {2}",
213 emptyMsg : "No core_enum found"
226 // if we do not have a selected type... - what should we show..?
227 var et = _this.data.etype;
228 var ds = _this.grid.getDataSource();
230 Roo.MessageBox.alert("Error", "Select a pulldown");
234 var add = ds.reader.newRow({
242 var r = ds.data.length;
244 _this.grid.startEditing(r, 1); // name...
247 cls : 'x-btn-text-icon',
249 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
259 xtype: 'ColumnModel',
262 header : 'Internal #',
264 renderer : function(v) { return String.format('{0}', v); }
267 xtype: 'ColumnModel',
272 renderer : function(v) { return String.format('{0}', v); },
283 xtype: 'ColumnModel',
285 dataIndex : 'display_name',
286 header : 'Display Name',
288 renderer : function(v) { return String.format('{0}', v); },
299 xtype: 'ColumnModel',
301 dataIndex : 'active',
304 renderer : function(v) {
305 var state = v> 0 ? '-checked' : '';
307 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
312 xtype: 'ColumnModel',
318 renderer : function(v) { return String.format('{0}', v); },
323 xtype: 'NumberField',
325 allowDecimals : false,
326 allowNegative : true,
336 xtype: 'LayoutRegion',
344 click : function (_self, e)
355 click : function (_self, e)
357 var sel = _this.grid.selModel.getSelectedCell();
358 if (!sel && _this.callback) {
359 Roo.MessageBox.alert("Error", "Select an item");
364 if (_this.callback) {
365 var rec = _this.grid.ds.getAt(sel[0]);
366 _this.callback(rec.data);