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 title : "Pulldown Options",
41 activate : function() {
44 _this.grid.footer.onClick('first');
52 tableName : 'core_enum',
53 title : "Pulldown Options",
61 //_this.dialog = Pman.Dialog.FILL_IN
62 if (_this.panel.active) {
63 this.footer.onClick('first');
66 afteredit : function (e)
70 cellclick : function (_self, rowIndex, columnIndex, e)
73 var di = this.colModel.getDataIndex(columnIndex);
78 var rec = _this.grid.ds.getAt(rowIndex);
80 rec.set('active', rec.data.active ? 0 : 1);
85 beforeedit : function (e)
87 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
92 autoExpandColumn : 'display_name',
99 beforeload : function (_self, options)
101 if (!_this.etypeCombo) {
104 options.params.etype = _this.etypeCombo.getValue();
105 if (!options.params.etype.length) {
109 update : function (_self, record, operation)
111 if (operation != Roo.data.Record.COMMIT) {
116 url : baseURL + '/Roo/Core_enum.php',
120 etype : _this.etypeCombo.getValue(),
121 name : record.data.name,
122 active : record.data.active,
123 seqid : record.data.seqid,
124 display_name : record.data.display_name
126 success : function(res) {
128 // update the ID if it's not set..
129 if (record.data.id * 1 < 1) {
130 record.set('id', res.data.id);
138 sortInfo : { field : 'etype', direction: 'ASC' },
143 url : baseURL + '/Roo/core_enum.php'
148 totalProperty : 'total',
176 xtype: 'PagingToolbar',
180 displayMsg : "Displaying core_enum{0} - {1} of {2}",
181 emptyMsg : "No core_enum found",
187 click : function (_self, e)
192 Roo.MessageBox.alert("Downloading", "File is downloading");
206 text : "Pulldown Name:"
212 render : function (_self)
214 _this.etypeCombo = _self;
216 select : function (combo, record, index)
218 _this.grid.footer.onClick('first');
222 displayField : 'name',
224 emptyText : "Select pulldown",
225 fieldLabel : 'core_enum',
226 forceSelection : true,
228 loadingText : "Searching...",
231 qtip : "Select type",
232 queryParam : 'query[name]',
233 selectOnFocus : true,
234 tpl : '<div class="x-grid-cell-text x-btn button"><b>{display_name}</b> - {name} </div>',
235 triggerAction : 'all',
243 beforeload : function (_self, o){
244 o.params = o.params || {};
246 o.params['query[empty_etype]'] = 1;
250 sortInfo : { direction : 'ASC', field: 'display_name' },
255 url : baseURL + '/Roo/core_enum.php'
262 totalProperty : 'total',
263 fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}]
274 // if we do not have a selected type... - what should we show..?
275 var et = _this.etypeCombo.getValue();
276 var ds = _this.grid.getDataSource();
278 Roo.MessageBox.alert("Error", "Select a pulldown");
282 var add = ds.reader.newRow({
290 var r = ds.data.length;
292 _this.grid.startEditing(r, 1); // name...
295 cls : 'x-btn-text-icon',
297 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
306 // if we do not have a selected type... - what should we show..?
307 var et = _this.etypeCombo.getValue();
310 Roo.MessageBox.alert("Error", "Select a pulldown");
313 var sc = _this.grid.getSelectionModel().getSelectedCell();
315 var ds = _this.grid.ds.getAt(sc[0]);
317 Roo.MessageBox.alert("Error", "Select enum");
322 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
323 _this.grid.footer.onClick('first');
328 cls : 'x-btn-text-icon',
330 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
343 Roo.MessageBox.prompt ("Create a new Enum type",
344 "Enter the name for a new enum type, " +
345 "this is only relivant if you know how it is going to be used",
351 url : baseURL + '/Roo/Core_enum.php',
358 success : function() {
359 Roo.MessageBox.alert("Created", "You can now select it from the type list on the left");
373 cls : 'x-btn-text-icon',
374 text : "Add new pulldown list",
375 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
381 xtype: 'ColumnModel',
384 header : 'Internal #',
386 renderer : function(v) { return String.format('{0}', v); }
389 xtype: 'ColumnModel',
391 dataIndex : 'images_id_id',
394 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/25/{1}/{2}" width="25" height="25">', baseURL, v, r.data.images_id_filename); }
397 xtype: 'ColumnModel',
402 renderer : function(v) { return String.format('{0}', v); },
413 xtype: 'ColumnModel',
415 dataIndex : 'display_name',
416 header : 'Display Name',
418 renderer : function(v) { return String.format('{0}', v); },
429 xtype: 'ColumnModel',
431 dataIndex : 'active',
434 renderer : function(v) {
435 var state = v> 0 ? '-checked' : '';
437 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
442 xtype: 'ColumnModel',
448 renderer : function(v) { return String.format('{0}', v); },
453 xtype: 'NumberField',
455 allowDecimals : false,
456 allowNegative : true,
466 xtype: 'LayoutRegion',