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',
40 activate : function() {
43 _this.grid.footer.onClick('first');
51 tableName : 'core_enum',
52 title : "Pulldown Options",
60 //_this.dialog = Pman.Dialog.FILL_IN
61 if (_this.panel.active) {
62 this.footer.onClick('first');
65 afteredit : function (e)
69 cellclick : function (_self, rowIndex, columnIndex, e)
72 var di = this.colModel.getDataIndex(columnIndex);
77 var rec = _this.grid.ds.getAt(rowIndex);
79 rec.set('active', rec.data.active ? 0 : 1);
84 beforeedit : function (e)
86 if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
91 autoExpandColumn : 'display_name',
98 beforeload : function (_self, options)
100 if (!_this.etypeCombo) {
103 options.params.etype = _this.etypeCombo.getValue();
104 if (!options.params.etype.length) {
108 update : function (_self, record, operation)
110 if (operation != Roo.data.Record.COMMIT) {
115 url : baseURL + '/Roo/Core_enum.php',
119 etype : _this.etypeCombo.getValue(),
120 name : record.data.name,
121 active : record.data.active,
122 seqid : record.data.seqid,
123 display_name : record.data.display_name
125 success : function(res) {
127 // update the ID if it's not set..
128 if (record.data.id * 1 < 1) {
129 record.set('id', res.data.id);
137 sortInfo : { field : 'etype', direction: 'ASC' },
142 url : baseURL + '/Roo/core_enum.php'
147 totalProperty : 'total',
175 xtype: 'PagingToolbar',
179 displayMsg : "Displaying core_enum{0} - {1} of {2}",
180 emptyMsg : "No core_enum found",
186 click : function (_self, e)
191 Roo.MessageBox.alert("Downloading", "File is downloading");
205 text : "Pulldown Name:"
211 render : function (_self)
213 _this.etypeCombo = _self;
215 select : function (combo, record, index)
217 _this.grid.footer.onClick('first');
221 displayField : 'name',
223 emptyText : "Select pulldown",
224 fieldLabel : 'core_enum',
225 forceSelection : true,
227 loadingText : "Searching...",
230 qtip : "Select type",
231 queryParam : 'query[name]',
232 selectOnFocus : true,
233 tpl : '<div class="x-grid-cell-text x-btn button"><b>{display_name}</b> - {name} </div>',
234 triggerAction : 'all',
242 beforeload : function (_self, o){
243 o.params = o.params || {};
245 o.params['query[empty_etype]'] = 1;
249 sortInfo : { direction : 'ASC', field: 'display_name' },
254 url : baseURL + '/Roo/core_enum.php'
261 totalProperty : 'total',
262 fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}]
273 // if we do not have a selected type... - what should we show..?
274 var et = _this.etypeCombo.getValue();
275 var ds = _this.grid.getDataSource();
277 Roo.MessageBox.alert("Error", "Select a pulldown");
281 var add = ds.reader.newRow({
289 var r = ds.data.length;
291 _this.grid.startEditing(r, 1); // name...
294 cls : 'x-btn-text-icon',
296 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
305 // if we do not have a selected type... - what should we show..?
306 var et = _this.etypeCombo.getValue();
309 Roo.MessageBox.alert("Error", "Select a pulldown");
312 var sc = _this.grid.getSelectionModel().getSelectedCell();
314 var ds = _this.grid.ds.getAt(sc[0]);
316 Roo.MessageBox.alert("Error", "Select enum");
321 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
322 _this.grid.footer.onClick('first');
327 cls : 'x-btn-text-icon',
329 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
342 Roo.MessageBox.prompt ("Create a new Enum type",
343 "Enter the name for a new enum type, " +
344 "this is only relivant if you know how it is going to be used",
350 url : baseURL + '/Roo/Core_enum.php',
357 success : function() {
358 Roo.MessageBox.alert("Created", "You can now select it from the type list on the left");
372 cls : 'x-btn-text-icon',
373 text : "Add new pulldown list",
374 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
380 xtype: 'ColumnModel',
383 header : 'Internal #',
385 renderer : function(v) { return String.format('{0}', v); }
388 xtype: 'ColumnModel',
390 dataIndex : 'images_id_id',
393 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); }
396 xtype: 'ColumnModel',
401 renderer : function(v) { return String.format('{0}', v); },
412 xtype: 'ColumnModel',
414 dataIndex : 'display_name',
415 header : 'Display Name',
417 renderer : function(v) { return String.format('{0}', v); },
428 xtype: 'ColumnModel',
430 dataIndex : 'active',
433 renderer : function(v) {
434 var state = v> 0 ? '-checked' : '';
436 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
441 xtype: 'ColumnModel',
447 renderer : function(v) { return String.format('{0}', v); },
452 xtype: 'NumberField',
454 allowDecimals : false,
455 allowNegative : true,
465 xtype: 'LayoutRegion',