]>
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
);
23 me
.renderData
.rows
= rows
;
24 me
.callParent(arguments
);
28 '<tpl for="columns">' +
29 '<td>{{dataIndex}}</td>' +
33 metaRenderTpl
: '<h1>{title}</h1>' +
34 '<table border="1" cellspacing="0" cellpadding="0">' +
35 '<tr><tpl for="columns">' +
36 '<th><div id="{parent.id}-th-resize{#}" style="background-color:red;">{header}</div></th>' +
38 '{[this.openRows()]}' +
40 '{[this.closeRows()]}' +
43 initComponent : function() {
46 Ext
.Array
.each(me
.columns
, function(col
, i
) {
49 if (!col
.minWidth
|| (col
.minWidth
< 10))
51 if (col
.width
< col
.minWidth
)
52 col
.width
= col
.minWidth
;
55 var metaRowTpl
= Ext
.create('Ext.XTemplate', me
.metaRowTpl
);
56 me
.row
= metaRowTpl
.applyTemplate(me
);
58 var metaTpl
= Ext
.create('Ext.XTemplate', me
.metaRenderTpl
, {
59 openRows: function() {
60 return '<tpl for="rows">';
63 closeRows: function() {
67 var tpl
= metaTpl
.applyTemplate(me
);
69 //console.log("TEST1 " + tpl);
78 me
.on('afterrender', function() {
79 Ext
.Array
.each(me
.columns
, function(col
, i
) {
80 var myid
= me
.getId() + '-th-resize' + (i
+1);
81 var rz
= Ext
.create('Ext.resizer.Resizer', {
84 minWidth
: col
.minWidth
,
87 resize: function(t
, width
, height
) {
88 var target
= t
.getTarget();
89 var parent
= target
.parent();
90 parent
.setWidth(width
);
91 t
.el
.setWidth(parent
.getWidth()-1);
95 rz
.resizeTo(col
.width
);