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',
38 activate : function() {
41 _this.grid.footer.onClick('first');
49 tableName : 'core_enum',
50 title : "Pulldown Options",
58 //_this.dialog = Pman.Dialog.FILL_IN
59 if (_this.panel.active) {
60 this.footer.onClick('first');
63 afteredit : function (e)
67 cellclick : function (_self, rowIndex, columnIndex, e)
70 var di = this.colModel.getDataIndex(columnIndex);
75 var rec = _this.grid.ds.getAt(rowIndex);
77 rec.set('active', rec.data.active ? 0 : 1);
82 beforeedit : function (e)
84 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
89 autoExpandColumn : 'display_name',
96 beforeload : function (_self, options)
98 if (!_this.etypeCombo) {
101 options.params.etype = _this.etypeCombo.getValue();
102 if (!options.params.etype.length) {
106 update : function (_self, record, operation)
108 if (operation != Roo.data.Record.COMMIT) {
113 url : baseURL + '/Roo/Core_enum.php',
117 etype : _this.etypeCombo.getValue(),
118 name : record.data.name,
119 active : record.data.active,
120 seqid : record.data.seqid,
121 display_name : record.data.display_name
123 success : function(res) {
125 // update the ID if it's not set..
126 if (record.data.id * 1 < 1) {
127 record.set('id', res.data.id);
135 sortInfo : { field : 'etype', direction: 'ASC' },
140 url : baseURL + '/Roo/core_enum.php'
145 totalProperty : 'total',
173 xtype: 'PagingToolbar',
177 displayMsg : "Displaying core_enum{0} - {1} of {2}",
178 emptyMsg : "No core_enum found",
184 click : function (_self, e)
189 Roo.MessageBox.alert("Downloading", "File is downloading");
203 text : "Pulldown Name:"
209 render : function (_self)
211 _this.etypeCombo = _self;
213 select : function (combo, record, index)
215 _this.grid.footer.onClick('first');
219 displayField : 'name',
221 emptyText : "Select pulldown",
222 fieldLabel : 'core_enum',
223 forceSelection : true,
225 loadingText : "Searching...",
228 qtip : "Select type",
229 queryParam : 'query[name]',
230 selectOnFocus : true,
231 tpl : '<div class="x-grid-cell-text x-btn button"><b>{display_name}</b> - {name} </div>',
232 triggerAction : 'all',
240 beforeload : function (_self, o){
241 o.params = o.params || {};
243 o.params['query[empty_etype]'] = 1;
247 sortInfo : { direction : 'ASC', field: 'display_name' },
252 url : baseURL + '/Roo/core_enum.php'
259 totalProperty : 'total',
260 fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}]
271 // if we do not have a selected type... - what should we show..?
272 var et = _this.etypeCombo.getValue();
273 var ds = _this.grid.getDataSource();
275 Roo.MessageBox.alert("Error", "Select a pulldown");
279 var add = ds.reader.newRow({
287 var r = ds.data.length;
289 _this.grid.startEditing(r, 1); // name...
292 cls : 'x-btn-text-icon',
294 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
303 // if we do not have a selected type... - what should we show..?
304 var et = _this.etypeCombo.getValue();
307 Roo.MessageBox.alert("Error", "Select a pulldown");
310 var sc = _this.grid.getSelectionModel().getSelectedCell();
312 var ds = _this.grid.ds.getAt(sc[0]);
314 Roo.MessageBox.alert("Error", "Select enum");
319 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
320 _this.grid.footer.onClick('first');
325 cls : 'x-btn-text-icon',
327 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
340 Roo.MessageBox.prompt ("Create a new Enum type",
341 "Enter the name for a new enum type, " +
342 "this is only relivant if you know how it is going to be used",
348 url : baseURL + '/Roo/Core_enum.php',
355 success : function() {
356 Roo.MessageBox.alert("Created", "You can now select it from the type list on the left");
370 cls : 'x-btn-text-icon',
371 text : "Add new pulldown list",
372 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
378 xtype: 'ColumnModel',
381 header : 'Internal #',
383 renderer : function(v) { return String.format('{0}', v); }
386 xtype: 'ColumnModel',
388 dataIndex : 'images_id_id',
391 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); }
394 xtype: 'ColumnModel',
399 renderer : function(v) { return String.format('{0}', v); },
410 xtype: 'ColumnModel',
412 dataIndex : 'display_name',
413 header : 'Display Name',
415 renderer : function(v) { return String.format('{0}', v); },
426 xtype: 'ColumnModel',
428 dataIndex : 'active',
431 renderer : function(v) {
432 var state = v> 0 ? '-checked' : '';
434 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
439 xtype: 'ColumnModel',
445 renderer : function(v) { return String.format('{0}', v); },
450 xtype: 'NumberField',
452 allowDecimals : false,
453 allowNegative : true,
463 xtype: 'LayoutRegion',