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');
77 xtype : 'LayoutRegion',
84 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
86 click : function (_self, e)
96 text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */,
98 click : function (_self, e)
100 var sel = _this.grid.selModel.getSelectedCell();
101 if (!sel && _this.callback) {
102 Roo.MessageBox.alert("Error", "Select an item");
107 if (_this.callback) {
108 var rec = _this.grid.ds.getAt(sel[0]);
109 _this.callback(rec.data);
124 tableName : 'core_enum',
125 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
127 activate : function() {
130 // _this.grid.footer.onClick('first');
138 xtype : 'EditorGrid',
139 autoExpandColumn : 'display_name',
143 afteredit : function (e)
147 beforeedit : function (e)
150 // force fill in of name first.. (Except when it's hidden)
151 if (typeof(_this.data._hide_name) != 'undefined') {
152 if(e.field == 'display_name' && e.record.data.is_system_enum*1 == 1){
158 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
159 Roo.log("block name?");
163 cellclick : function (_self, rowIndex, columnIndex, e)
166 var di = this.colModel.getDataIndex(columnIndex);
167 if (di != 'active') {
171 var rec = _this.grid.ds.getAt(rowIndex);
173 rec.set('active', rec.data.active ? 0 : 1);
181 //_this.dialog = Pman.Dialog.FILL_IN
182 if (_this.panel.active) {
183 // this.footer.onClick('first');
190 xtype : 'PagingToolbar',
192 displayMsg : _this._strings['510bc6e58593b2b8002c9fe0c21f3fde'] /* Displaying core_enum{0} - {1} of {2} */,
193 emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'] /* No core_enum found */,
205 cls : 'x-btn-text-icon',
206 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
207 text : _this._strings['d9ec74f5aa29ceef6bf7b45f7fec5d0f'] /* Add Value */,
212 // if we do not have a selected type... - what should we show..?
213 var et = _this.data.etype;
214 var ds = _this.grid.getDataSource();
216 Roo.MessageBox.alert("Error", "Select a pulldown");
220 var add = ds.reader.newRow({
228 var r = ds.data.length;
232 if (typeof(_this.data._hide_name) != 'undefined') {
235 _this.grid.startEditing(r, ec); // name...
239 '|xns' : 'Roo.Toolbar'
244 '|xns' : 'Roo.Toolbar'
251 sortInfo : { field : 'etype', direction: 'ASC' },
253 beforeload : function (_self, options)
256 options.params.etype = _this.data.etype;
257 if (!options.params.etype.length) {
261 update : function (_self, record, operation)
263 if (operation != Roo.data.Record.COMMIT) {
268 if (typeof(_this.data._hide_name) != 'undefined') {
269 record.set('name', record.data.display_name);
271 if (!record.data.name.length) {
277 url : baseURL + '/Roo/Core_enum.php',
281 etype : _this.data.etype,
282 name : record.data.name,
283 active : record.data.active,
284 seqid : record.data.seqid,
285 display_name : record.data.display_name
287 success : function(res) {
289 // update the ID if it's not set..
290 if (record.data.id * 1 < 1) {
291 record.set('id', res.data.id);
303 url : baseURL + '/Roo/core_enum.php',
308 xtype : 'JsonReader',
333 totalProperty : 'total',
340 xtype : 'ColumnModel',
342 header : _this._strings['7af54708cf5a4286cf0cfa58ff5148a8'] /* Internal # */,
343 renderer : function(v) { return String.format('{0}', v); },
349 xtype : 'ColumnModel',
351 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
352 renderer : function(v) { return String.format('{0}', v); },
357 xtype : 'GridEditor',
368 xtype : 'ColumnModel',
369 dataIndex : 'display_name',
370 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
371 renderer : function(v) { return String.format('{0}', v); },
376 xtype : 'GridEditor',
387 xtype : 'ColumnModel',
388 dataIndex : 'active',
389 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
390 renderer : function(v) {
391 var state = v> 0 ? '-checked' : '';
393 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
401 xtype : 'ColumnModel',
403 header : _this._strings['d1228f5476d15142b1358ae4b5fa2454'] /* Order # */,
404 renderer : function(v) { return String.format('{0}', v); },
410 xtype : 'GridEditor',
414 xtype : 'NumberField',
415 allowDecimals : false,
416 allowNegative : true,
417 decimalPrecision : 0,