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.. (Except when it's hidden)
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){
113 Roo.log("block name?");
118 autoExpandColumn : 'display_name',
125 beforeload : function (_self, options)
128 options.params.etype = _this.data.etype;
129 if (!options.params.etype.length) {
133 update : function (_self, record, operation)
135 if (operation != Roo.data.Record.COMMIT) {
140 if (typeof(_this.data._hide_name) != 'undefined') {
141 record.set('name', record.data.display_name);
143 if (!record.data.name.length) {
149 url : baseURL + '/Roo/Core_enum.php',
153 etype : _this.data.etype,
154 name : record.data.name,
155 active : record.data.active,
156 seqid : record.data.seqid,
157 display_name : record.data.display_name
159 success : function(res) {
161 // update the ID if it's not set..
162 if (record.data.id * 1 < 1) {
163 record.set('id', res.data.id);
171 sortInfo : { field : 'etype', direction: 'ASC' },
176 url : baseURL + '/Roo/core_enum.php'
181 totalProperty : 'total',
209 xtype: 'PagingToolbar',
213 displayMsg : "Displaying core_enum{0} - {1} of {2}",
214 emptyMsg : "No core_enum found"
227 // if we do not have a selected type... - what should we show..?
228 var et = _this.data.etype;
229 var ds = _this.grid.getDataSource();
231 Roo.MessageBox.alert("Error", "Select a pulldown");
235 var add = ds.reader.newRow({
243 var r = ds.data.length;
245 _this.grid.startEditing(r, 1); // name...
248 cls : 'x-btn-text-icon',
250 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
260 xtype: 'ColumnModel',
263 header : 'Internal #',
265 renderer : function(v) { return String.format('{0}', v); }
268 xtype: 'ColumnModel',
273 renderer : function(v) { return String.format('{0}', v); },
284 xtype: 'ColumnModel',
286 dataIndex : 'display_name',
287 header : 'Display Name',
289 renderer : function(v) { return String.format('{0}', v); },
300 xtype: 'ColumnModel',
302 dataIndex : 'active',
305 renderer : function(v) {
306 var state = v> 0 ? '-checked' : '';
308 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
313 xtype: 'ColumnModel',
319 renderer : function(v) { return String.format('{0}', v); },
324 xtype: 'NumberField',
326 allowDecimals : false,
327 allowNegative : true,
337 xtype: 'LayoutRegion',
345 click : function (_self, e)
356 click : function (_self, e)
358 var sel = _this.grid.selModel.getSelectedCell();
359 if (!sel && _this.callback) {
360 Roo.MessageBox.alert("Error", "Select an item");
365 if (_this.callback) {
366 var rec = _this.grid.ds.getAt(sel[0]);
367 _this.callback(rec.data);