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"
190 text : "Pulldown Name:"
196 render : function (_self)
198 _this.etypeCombo = _self;
200 select : function (combo, record, index)
202 _this.grid.footer.onClick('first');
206 displayField : 'name',
208 emptyText : "Select pulldown",
209 fieldLabel : 'core_enum',
210 forceSelection : true,
212 loadingText : "Searching...",
215 qtip : "Select type",
216 queryParam : 'query[name]',
217 selectOnFocus : true,
218 tpl : '<div class="x-grid-cell-text x-btn button"><b>{display_name}</b> - {name} </div>',
219 triggerAction : 'all',
227 beforeload : function (_self, o){
228 o.params = o.params || {};
230 o.params['query[empty_etype]'] = 1;
234 sortInfo : { direction : 'ASC', field: 'display_name' },
239 url : baseURL + '/Roo/core_enum.php'
246 totalProperty : 'total',
247 fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}]
258 // if we do not have a selected type... - what should we show..?
259 var et = _this.etypeCombo.getValue();
260 var ds = _this.grid.getDataSource();
262 Roo.MessageBox.alert("Error", "Select a pulldown");
266 var add = ds.reader.newRow({
274 var r = ds.data.length;
276 _this.grid.startEditing(r, 1); // name...
279 cls : 'x-btn-text-icon',
281 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
290 // if we do not have a selected type... - what should we show..?
291 var et = _this.etypeCombo.getValue();
294 Roo.MessageBox.alert("Error", "Select a pulldown");
297 var sc = _this.grid.getSelectionModel().getSelectedCell();
299 var ds = _this.grid.ds.getAt(sc[0]);
301 Roo.MessageBox.alert("Error", "Select enum");
306 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
307 _this.grid.footer.onClick('first');
312 cls : 'x-btn-text-icon',
314 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
327 Roo.MessageBox.prompt ("Create a new Enum type",
328 "Enter the name for a new enum type, " +
329 "this is only relivant if you know how it is going to be used",
335 url : baseURL + '/Roo/Core_enum.php',
342 success : function() {
343 Roo.MessageBox.alert("Created", "You can now select it from the type list on the left");
357 cls : 'x-btn-text-icon',
358 text : "Add new pulldown list",
359 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
365 xtype: 'ColumnModel',
368 header : 'Internal #',
370 renderer : function(v) { return String.format('{0}', v); }
373 xtype: 'ColumnModel',
375 dataIndex : 'images_id_id',
378 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); }
381 xtype: 'ColumnModel',
386 renderer : function(v) { return String.format('{0}', v); },
397 xtype: 'ColumnModel',
399 dataIndex : 'display_name',
400 header : 'Display Name',
402 renderer : function(v) { return String.format('{0}', v); },
413 xtype: 'ColumnModel',
415 dataIndex : 'active',
418 renderer : function(v) {
419 var state = v> 0 ? '-checked' : '';
421 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
426 xtype: 'ColumnModel',
432 renderer : function(v) { return String.format('{0}', v); },
437 xtype: 'NumberField',
439 allowDecimals : false,
440 allowNegative : true,
450 xtype: 'LayoutRegion',