PDA

View Full Version : extjs 4.2 propertygrid and tooltip (qtip)



dkjśrgaard
19 Jun 2013, 3:55 AM
Hi

What would be the simplest way to add a tooltip to the name/property column in a propertygrid? Furthermore is there a way to add button in the same column?

Thanks.

-Danny

chamacs
19 Jun 2013, 1:24 PM
For the second question, you could you this:

http://skirtlesden.com/ux/component-column

(http://skirtlesden.com/ux/component-column)

slemmon
20 Jun 2013, 7:21 PM
There's not really a straight-forward, public method / property way to grab a reference to the column headers, but if you're ok with using some private properties (which can change without warning between versions) then you can do the following:



Ext.create('Ext.grid.property.Grid', {
title: 'Properties Grid',
width: 300,
renderTo: Ext.getBody(),
source: {
"(name)": "My Object",
"Created": Ext.Date.parse('10/15/2006', 'm/d/Y'),
"Available": false,
"Version": 0.01,
"Description": "A test object"
},
listeners: {
afterrender: function () {
var columns = this.columns;
Ext.create('Ext.tip.ToolTip', {
target: columns[0].getEl(),
html: columns[0].text
});

Ext.create('Ext.tip.ToolTip', {
target: columns[1].getEl(),
html: columns[1].text
});
}
}
});