]>
git.proxmox.com Git - pve2-api-doc.git/blob - data/PVETable.js
1 // just a test - not usable now
3 Ext
.define('PVE.Table', {
4 extend
: 'Ext.Component',
6 alias
: 'widget.pvetable',
11 Ext
.applyIf(me
.renderData
, {
18 me
.store
.each(function(record
) {
19 rows
.push(record
.data
);
22 me
.renderData
.rows
= rows
;
23 me
.callParent(arguments
);
27 '<tpl for="columns">' +
28 '<td>{{dataIndex}}</td>' +
32 metaRenderTpl
: '<h1>{title}</h1>' +
33 '<table border="1" cellspacing="0" cellpadding="0">' +
34 '<tr><tpl for="columns">' +
35 '<th><div id="{parent.id}-th-resize{#}" style="background-color:red;">{header}</div></th>' +
37 '{[this.openRows()]}' +
39 '{[this.closeRows()]}' +
42 initComponent : function() {
45 Ext
.Array
.each(me
.columns
, function(col
, i
) {
48 if (!col
.minWidth
|| (col
.minWidth
< 10))
50 if (col
.width
< col
.minWidth
)
51 col
.width
= col
.minWidth
;
54 var metaRowTpl
= Ext
.create('Ext.XTemplate', me
.metaRowTpl
);
55 me
.row
= metaRowTpl
.applyTemplate(me
);
57 var metaTpl
= Ext
.create('Ext.XTemplate', me
.metaRenderTpl
, {
58 openRows: function() {
59 return '<tpl for="rows">';
62 closeRows: function() {
66 var tpl
= metaTpl
.applyTemplate(me
);
68 //console.log("TEST1 " + tpl);
77 me
.on('afterrender', function() {
78 Ext
.Array
.each(me
.columns
, function(col
, i
) {
79 var myid
= me
.getId() + '-th-resize' + (i
+1);
80 var rz
= Ext
.create('Ext.resizer.Resizer', {
83 minWidth
: col
.minWidth
,
86 resize: function(t
, width
, height
) {
87 var target
= t
.getTarget();
88 var parent
= target
.parent();
89 parent
.setWidth(width
);
90 t
.el
.setWidth(parent
.getWidth()-1);
94 rz
.resizeTo(col
.width
);