1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.AdminCoreEnum = {
10 '2df80d5febcde0c10a66818488622b7c' :"Pulldown Options",
11 'd1228f5476d15142b1358ae4b5fa2454' :"Order #",
12 '7af54708cf5a4286cf0cfa58ff5148a8' :"Internal #",
13 'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
14 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
15 '510bc6e58593b2b8002c9fe0c21f3fde' :"Displaying core_enum{0} - {1} of {2}",
16 '1ba4d808fc7b27a7f60ce2ff75a8af3a' :"No core_enum found",
17 'd9ec74f5aa29ceef6bf7b45f7fec5d0f' :"Add Value",
18 '49ee3087348e8d44e1feda1917443987' :"Name",
19 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
20 'e0aa021e21dddbd6d8cecec71e9cf564' :"OK"
26 show : function(data, cb)
34 this.dialog.show(this.data._el);
37 this.form.setValues(data);
38 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
46 this.dialog = Roo.factory({
47 xtype : 'LayoutDialog',
52 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
55 show : function (_self)
57 if(!isAdmin && Pman.Tab.Hopedb){
58 Roo.MessageBox.alert("Error", "Permission Denied", function(){
63 var name_hidden = false;
65 if (typeof(_this.data._hide_name) != 'undefined') {
70 _this.grid.colModel.setHidden(1,name_hidden);
71 _this.grid.footer.onClick('first');
78 xtype : 'LayoutRegion',
85 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
87 click : function (_self, e)
97 text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */,
99 click : function (_self, e)
101 var sel = _this.grid.selModel.getSelectedCell();
102 if (!sel && _this.callback) {
103 Roo.MessageBox.alert("Error", "Select an item");
108 if (_this.callback) {
109 var rec = _this.grid.ds.getAt(sel[0]);
110 _this.callback(rec.data);
125 tableName : 'core_enum',
126 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
128 activate : function() {
131 // _this.grid.footer.onClick('first');
139 xtype : 'EditorGrid',
140 autoExpandColumn : 'display_name',
144 afteredit : function (e)
148 beforeedit : function (e)
151 // force fill in of name first.. (Except when it's hidden)
152 if (typeof(_this.data._hide_name) != 'undefined') {
153 if(e.field == 'display_name' && e.record.data.is_system_enum*1 == 1){
159 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
160 Roo.log("block name?");
164 cellclick : function (_self, rowIndex, columnIndex, e)
167 var di = this.colModel.getDataIndex(columnIndex);
168 if (di != 'active') {
172 var rec = _this.grid.ds.getAt(rowIndex);
174 rec.set('active', rec.data.active ? 0 : 1);
182 //_this.dialog = Pman.Dialog.FILL_IN
183 if (_this.panel.active) {
184 // this.footer.onClick('first');
191 xtype : 'PagingToolbar',
193 displayMsg : _this._strings['510bc6e58593b2b8002c9fe0c21f3fde'] /* Displaying core_enum{0} - {1} of {2} */,
194 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'] /* No core_enum found */,
206 cls : 'x-btn-text-icon',
207 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
208 text : _this._strings['d9ec74f5aa29ceef6bf7b45f7fec5d0f'] /* Add Value */,
213 // if we do not have a selected type... - what should we show..?
214 var et = _this.data.etype;
215 var ds = _this.grid.getDataSource();
217 Roo.MessageBox.alert("Error", "Select a pulldown");
221 var add = ds.reader.newRow({
229 var r = ds.data.length;
233 if (typeof(_this.data._hide_name) != 'undefined') {
236 _this.grid.startEditing(r, ec); // name...
240 '|xns' : 'Roo.Toolbar'
245 '|xns' : 'Roo.Toolbar'
252 sortInfo : { field : 'etype', direction: 'ASC' },
254 beforeload : function (_self, options)
257 options.params.etype = _this.data.etype;
258 if (!options.params.etype.length) {
266 update : function (_self, record, operation)
268 if (operation != Roo.data.Record.COMMIT) {
273 if (typeof(_this.data._hide_name) != 'undefined') {
274 record.set('name', record.data.display_name);
276 if (!record.data.name.length) {
282 url : baseURL + '/Roo/Core_enum.php',
286 etype : _this.data.etype,
287 name : record.data.name,
288 active : record.data.active,
289 seqid : record.data.seqid,
290 display_name : record.data.display_name
292 success : function(res) {
294 // update the ID if it's not set..
295 if (record.data.id * 1 < 1) {
296 record.set('id', res.data.id);
308 url : baseURL + '/Roo/core_enum.php',
313 xtype : 'JsonReader',
338 totalProperty : 'total',
345 xtype : 'ColumnModel',
347 header : _this._strings['7af54708cf5a4286cf0cfa58ff5148a8'] /* Internal # */,
348 renderer : function(v) { return String.format('{0}', v); },
354 xtype : 'ColumnModel',
356 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
357 renderer : function(v) { return String.format('{0}', v); },
362 xtype : 'GridEditor',
373 xtype : 'ColumnModel',
374 dataIndex : 'display_name',
375 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
376 renderer : function(v) { return String.format('{0}', v); },
381 xtype : 'GridEditor',
392 xtype : 'ColumnModel',
393 dataIndex : 'active',
394 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
395 renderer : function(v) {
396 var state = v> 0 ? '-checked' : '';
398 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
406 xtype : 'ColumnModel',
408 header : _this._strings['d1228f5476d15142b1358ae4b5fa2454'] /* Order # */,
409 renderer : function(v) { return String.format('{0}', v); },
415 xtype : 'GridEditor',
419 xtype : 'NumberField',
420 allowDecimals : false,
421 allowNegative : true,
422 decimalPrecision : 0,