1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.AdminEnums = new Roo.XComponent({
6 part : ["Admin","Enums"],
7 order : '500-Pman.Tab.AdminEnums',
9 parent : 'Pman.Tab.Admin',
10 name : "Pman.Tab.AdminEnums",
12 permname : 'Admin.Enums',
21 activate : function() {
24 _this.grid.footer.onClick('first');
32 tableName : 'core_enum',
33 title : "Pulldown Options",
41 //_this.dialog = Pman.Dialog.FILL_IN
42 if (_this.panel.active) {
43 this.footer.onClick('first');
46 afteredit : function (e)
50 cellclick : function (_self, rowIndex, columnIndex, e)
53 var di = this.colModel.getDataIndex(columnIndex);
58 var rec = _this.grid.ds.getAt(rowIndex);
60 rec.set('active', rec.data.active ? 0 : 1);
66 autoExpandColumn : 'display_name',
73 beforeload : function (_self, options)
75 if (!_this.etypeCombo) {
78 options.params.etype = _this.etypeCombo.getValue();
79 if (!options.params.etype.length) {
83 update : function (_self, record, operation)
85 if (operation != Roo.data.Record.COMMIT) {
90 url : baseURL + '/Roo/Core_enum.php',
94 etype : _this.etypeCombo.getValue(),
95 name : record.data.name,
96 active : record.data.active,
97 seqid : record.data.seqid,
98 display_name : record.data.display_name
100 success : function(res) {
102 // update the ID if it's not set..
103 if (record.data.id * 1 < 1) {
104 record.set('id', res.data.id);
112 sortInfo : { field : 'etype', direction: 'ASC' },
117 url : baseURL + '/Roo/core_enum.php'
122 totalProperty : 'total',
150 xtype: 'PagingToolbar',
154 displayMsg : "Displaying core_enum{0} - {1} of {2}",
155 emptyMsg : "No core_enum found"
164 text : "Pulldown Name:"
170 render : function (_self)
172 _this.etypeCombo = _self;
174 select : function (combo, record, index)
176 _this.grid.footer.onClick('first');
180 displayField : 'name',
182 emptyText : "Select pulldown",
183 fieldLabel : 'core_enum',
184 forceSelection : true,
186 loadingText : "Searching...",
189 qtip : "Select type",
190 queryParam : 'query[name]',
191 selectOnFocus : true,
192 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
193 triggerAction : 'all',
201 beforeload : function (_self, o){
202 o.params = o.params || {};
204 o.params['query[empty_etype]'] = 1;
208 sortInfo : { direction : 'ASC', field: 'id' },
213 url : baseURL + '/Roo/core_enum.php'
220 totalProperty : 'total',
221 fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}]
232 // if we do not have a selected type... - what should we show..?
233 var et = _this.etypeCombo.getValue();
234 var ds = _this.grid.getDataSource();
236 Roo.MessageBox.alert("Error", "Select a pulldown");
240 var add = ds.reader.newRow({
248 var r = ds.data.length;
250 _this.grid.startEditing(r, 1); // name...
253 cls : 'x-btn-text-icon',
255 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
268 Roo.MessageBox.prompt ("Create a new Enum type",
269 "Enter the name for a new enum type, " +
270 "this is only relivant if you know how it is going to be used",
276 url : baseURL + '/Roo/Core_enum.php',
283 success : function() {
284 Roo.MessageBox.alert("Created", "You can now select it from the type list on the left");
298 cls : 'x-btn-text-icon',
299 text : "Add new pulldown list",
300 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
306 xtype: 'ColumnModel',
309 header : 'Internal #',
311 renderer : function(v) { return String.format('{0}', v); }
314 xtype: 'ColumnModel',
319 renderer : function(v) { return String.format('{0}', v); },
330 xtype: 'ColumnModel',
332 dataIndex : 'display_name',
333 header : 'Display Name',
335 renderer : function(v) { return String.format('{0}', v); },
346 xtype: 'ColumnModel',
348 dataIndex : 'active',
351 renderer : function(v) {
352 var state = v> 0 ? '-checked' : '';
354 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
359 xtype: 'ColumnModel',
365 renderer : function(v) { return String.format('{0}', v); },
370 xtype: 'NumberField',
372 allowDecimals : false,
373 allowNegative : true,