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 = {
12 show : function(data, cb)
20 this.dialog.show(this.data._el);
23 this.form.setValues(data);
24 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
32 this.dialog = Roo.factory({
35 xtype : 'LayoutRegion',
40 title : "Pulldown Options",
41 xtype : 'LayoutDialog',
54 click : function (_self, e)
66 click : function (_self, e)
68 var sel = _this.grid.selModel.getSelectedCell();
69 if (!sel && _this.callback) {
70 Roo.MessageBox.alert("Error", "Select an item");
76 var rec = _this.grid.ds.getAt(sel[0]);
77 _this.callback(rec.data);
85 show : function (_self)
87 if(!isAdmin && Pman.Tab.Hopedb){
88 Roo.MessageBox.alert("Error", "Permission Denied", function(){
93 var name_hidden = false;
95 if (typeof(_this.data._hide_name) != 'undefined') {
100 _this.grid.colModel.setHidden(1,name_hidden);
101 _this.grid.footer.onClick('first');
110 url : baseURL + '/Roo/core_enum.php',
119 xtype : 'JsonReader',
143 totalProperty : 'total'
148 sortInfo : { field : 'etype', direction: 'ASC' },
151 update : function (_self, record, operation)
153 if (operation != Roo.data.Record.COMMIT) {
158 if (typeof(_this.data._hide_name) != 'undefined') {
159 record.set('name', record.data.display_name);
161 if (!record.data.name.length) {
167 url : baseURL + '/Roo/Core_enum.php',
171 etype : _this.data.etype,
172 name : record.data.name,
173 active : record.data.active,
174 seqid : record.data.seqid,
175 display_name : record.data.display_name
177 success : function(res) {
179 // update the ID if it's not set..
180 if (record.data.id * 1 < 1) {
181 record.set('id', res.data.id);
187 beforeload : function (_self, options)
190 options.params.etype = _this.data.etype;
191 if (!options.params.etype.length) {
204 xtype : 'PagingToolbar',
205 emptyMsg : "No core_enum found",
208 displayMsg : "Displaying core_enum{0} - {1} of {2}"
216 '|xns' : 'Roo.Toolbar',
219 cls : 'x-btn-text-icon',
220 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
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;
246 if (typeof(_this.data._hide_name) != 'undefined') {
249 _this.grid.startEditing(r, ec); // name...
254 '|xns' : 'Roo.Toolbar',
262 autoExpandColumn : 'display_name',
263 xtype : 'EditorGrid',
270 xtype : 'ColumnModel',
271 header : 'Internal #',
273 renderer : function(v) { return String.format('{0}', v); },
285 xtype : 'GridEditor',
293 xtype : 'ColumnModel',
296 renderer : function(v) { return String.format('{0}', v); },
312 xtype : 'GridEditor',
320 xtype : 'ColumnModel',
321 header : 'Display Name',
323 renderer : function(v) { return String.format('{0}', v); },
325 dataIndex : 'display_name',
333 xtype : 'ColumnModel',
336 renderer : function(v) {
337 var state = v> 0 ? '-checked' : '';
339 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
349 allowNegative : true,
350 xtype : 'NumberField',
351 allowDecimals : false,
352 decimalPrecision : 0,
356 xtype : 'GridEditor',
364 xtype : 'ColumnModel',
368 renderer : function(v) { return String.format('{0}', v); },
378 beforeedit : function (e)
381 // force fill in of name first.. (Except when it's hidden)
382 if (typeof(_this.data._hide_name) != 'undefined') {
383 if(e.field == 'display_name' && e.record.data.is_system_enum*1 == 1){
389 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
390 Roo.log("block name?");
394 cellclick : function (_self, rowIndex, columnIndex, e)
397 var di = this.colModel.getDataIndex(columnIndex);
398 if (di != 'active') {
402 var rec = _this.grid.ds.getAt(rowIndex);
404 rec.set('active', rec.data.active ? 0 : 1);
412 //_this.dialog = Pman.Dialog.FILL_IN
413 if (_this.panel.active) {
414 // this.footer.onClick('first');
417 afteredit : function (e)
431 title : "Pulldown Options",
435 tableName : 'core_enum',
437 activate : function() {
440 // _this.grid.footer.onClick('first');