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 if(!isAdmin && Pman.Tab.Hopedb){
37 Roo.MessageBox.alert("Error", "Permission Denied", function(){
42 var name_hidden = false;
44 if (typeof(_this.data._hide_name) != 'undefined') {
49 _this.grid.colModel.setHidden(1,name_hidden);
50 _this.grid.footer.onClick('first');
57 title : "Pulldown Options",
64 activate : function() {
67 // _this.grid.footer.onClick('first');
75 tableName : 'core_enum',
76 title : "Pulldown Options",
84 //_this.dialog = Pman.Dialog.FILL_IN
85 if (_this.panel.active) {
86 // this.footer.onClick('first');
89 afteredit : function (e)
93 cellclick : function (_self, rowIndex, columnIndex, e)
96 var di = this.colModel.getDataIndex(columnIndex);
101 var rec = _this.grid.ds.getAt(rowIndex);
103 rec.set('active', rec.data.active ? 0 : 1);
108 beforeedit : function (e)
111 // force fill in of name first.. (Except when it's hidden)
112 if (typeof(_this.data._hide_name) != 'undefined') {
113 if(e.field == 'display_name' && e.record.data.is_system_enum*1 == 1){
119 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
120 Roo.log("block name?");
125 autoExpandColumn : 'display_name',
132 beforeload : function (_self, options)
135 options.params.etype = _this.data.etype;
136 if (!options.params.etype.length) {
140 update : function (_self, record, operation)
142 if (operation != Roo.data.Record.COMMIT) {
147 if (typeof(_this.data._hide_name) != 'undefined') {
148 record.set('name', record.data.display_name);
150 if (!record.data.name.length) {
156 url : baseURL + '/Roo/Core_enum.php',
160 etype : _this.data.etype,
161 name : record.data.name,
162 active : record.data.active,
163 seqid : record.data.seqid,
164 display_name : record.data.display_name
166 success : function(res) {
168 // update the ID if it's not set..
169 if (record.data.id * 1 < 1) {
170 record.set('id', res.data.id);
178 sortInfo : { field : 'etype', direction: 'ASC' },
183 url : baseURL + '/Roo/core_enum.php'
188 totalProperty : 'total',
216 xtype: 'PagingToolbar',
220 displayMsg : "Displaying core_enum{0} - {1} of {2}",
221 emptyMsg : "No core_enum found"
234 // if we do not have a selected type... - what should we show..?
235 var et = _this.data.etype;
236 var ds = _this.grid.getDataSource();
238 Roo.MessageBox.alert("Error", "Select a pulldown");
242 var add = ds.reader.newRow({
250 var r = ds.data.length;
254 if (typeof(_this.data._hide_name) != 'undefined') {
257 _this.grid.startEditing(r, ec); // name...
260 cls : 'x-btn-text-icon',
262 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
272 xtype: 'ColumnModel',
275 header : 'Internal #',
277 renderer : function(v) { return String.format('{0}', v); }
280 xtype: 'ColumnModel',
285 renderer : function(v) { return String.format('{0}', v); },
296 xtype: 'ColumnModel',
298 dataIndex : 'display_name',
299 header : 'Display Name',
301 renderer : function(v) { return String.format('{0}', v); },
312 xtype: 'ColumnModel',
314 dataIndex : 'active',
317 renderer : function(v) {
318 var state = v> 0 ? '-checked' : '';
320 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
325 xtype: 'ColumnModel',
331 renderer : function(v) { return String.format('{0}', v); },
336 xtype: 'NumberField',
338 allowDecimals : false,
339 allowNegative : true,
349 xtype: 'LayoutRegion',
357 click : function (_self, e)
368 click : function (_self, e)
370 var sel = _this.grid.selModel.getSelectedCell();
371 if (!sel && _this.callback) {
372 Roo.MessageBox.alert("Error", "Select an item");
377 if (_this.callback) {
378 var rec = _this.grid.ds.getAt(sel[0]);
379 _this.callback(rec.data);