PDA

View Full Version : Array-Grid in YUI



sailaja
3 Jan 2007, 10:14 PM
How to give anchor(href) tag to one coloumn in array-grid in YUI.So that when click on that coloumn element it navigates to another grid.

tryanDLS
4 Jan 2007, 9:02 AM
Add a renderer for the column to wrap the text in a link element. See the grid examples which use renderers to change data formats (e.g. numeric to money, or string to date)

BernardChhun
4 Jan 2007, 10:03 AM
Add a renderer for the column to wrap the text in a link element. See the grid examples which use renderers to change data formats (e.g. numeric to money, or string to date)

like this:

the function:



function href(value){
return '' + value + ''
}


when to call it:



// CALLBACK HERE
var colModel = new YAHOO.ext.grid.DefaultColumnModel([
{header: 'source', width: 150, sortable: true, renderer: href}]);

var grid = new YAHOO.ext.grid.Grid('myGrid', {
dataModel: dataModel,
colModel: colModel});

sailaja
10 Jan 2007, 3:18 AM
Hi,
Thanks alot for ur code.It helped me lot and i solved my problem.
Once again thank you for ur help.

Regards,
sailaja.