PDA

View Full Version : QuickTips for Grid Column



tookoo
29 May 2007, 7:10 PM
As show in the API document http://extjs.com/deploy/ext/docs/output/Ext.grid.ColumnModel.html#setColumnTooltip, column_model.setColumnTooltip() function only accepts string as the second parameter. Does it mean that I cannot use QuickTips as tooltips? I also used the following code to test it by myself. However, I got "[object Object]" displayed in the tooltip...... Any suggestion are appreciated.



......
Ext.QuickTips.init();
......
var cm = new Ext.grid.ColumnModel([{
header: "Common Name",
dataIndex: 'common',
width: 220,
tooltip: {text:'This is a quicktip', title:'tip header', autoHide: false},
editor: new Ed(new fm.TextField({
allowBlank: false
}))
},
.....
])

tookoo
30 May 2007, 11:43 AM
Can somebody shed some lights on this? Thanks.

jsakalos
30 May 2007, 12:37 PM
Yes it must be string in this case but the string can be html markup that will be displayed correctly.

tookoo
30 May 2007, 2:46 PM
Yes it must be string in this case but the string can be html markup that will be displayed correctly.
Then, is there an easy way to use QuickTips in Grid? Thanks.

jsakalos
30 May 2007, 2:50 PM
Then, is there an easy way to use QuickTips in Grid? Thanks.

I don't know what do you want to achieve but QuickTips can be used as the replacement of "title" attribute of any element (interceptTitles configuration parameter.

Or, you can add qtip attribute to any HTML tag and it will work.

Conclusion is that it will work in grids too.

tryanDLS
30 May 2007, 2:52 PM
Did you try to use QuickTips.register()?

Joy
15 Aug 2007, 1:15 AM
You can specify tooltip in ColumnModel



var wpTrackColumnModel = new Ext.grid.ColumnModel([
{
header : "WellplotID"
,hidden : true
,tooltip : "My Tooltip"
,dataIndex : "WP_ID"
,editor : new Ext.grid.GridEditor(new Ext.form.TextField({
allowBlank: false
}))
}
, ........]);
or simply set tooltip with

wpTrackColumnModel.setColumnTooltip(4, 'Hello');

Anyway these code examples add simple "browser" tooltip (like if you specify "title" attribute), but for example, I wanted "ext styled" tooltips, but found nothing... Maybe somebody know how-to