:: Forum >>

Fixed Columns?

Is it possible to create fixed columns? I would like to be able to make the two left most columns of my table fixed when doing horizontal scrolling.

Thanks so much for your great tool.
polytriks
Tuesday, January 6, 2004
I am going to add this functionality in the future. With the current version it is quite complicated.
Alex (ActiveWidgets)
Tuesday, January 6, 2004
Thanks for the quick reply.

If it is not too much trouble, could you give me a few hints on how this might be accomplished. I can probably figure it out, I'm just not sure where to start.

Thanks again.
polytriks
Wednesday, January 7, 2004
You can try this:

obj.setTemplate("left/item", new Active.Templates.Text);
obj.setProperty("row/text", function(i){return myData[i][0]});

it should replace the row headers with a text column.

The left fixed part is a list (see source/lib/controls/grid.js), so we use text template instead of header as a list item.

The next step would be using Active.Templates.Row as a list item for the left part (same way as for the main part). However there are lots of complication in how you supply data models, do selections etc. I think I would rather postpone this.
Alex (ActiveWidgets)
Wednesday, January 7, 2004
Alex, I have an implementation question and a bug report.

1) I'd like to extend the function when a column header is clicked. I'm not sure how to get to it.

var obj = new Active.Controls.Grid;
var column = new Active.Templates.Header;
column.setEvent("onclick",function(){this.action("HeaderClick")});
obj.setTemplate("column", column);

obj.setAction("HeaderClick",{alert(this.getSortProperty("index"))});


2). I found that setSortIndex(), setSortDirection(), and setColumnIndex() do not work, however their get counterparts do.
JJ
Thursday, January 29, 2004
JJ,

I asked about that a few posts ago.. see his example

http://www.activewidgets.com/messages/417-2.htm


Paul
Friday, January 30, 2004
This is a great little tool. Is there any way to make the cell contents into links? For example, "Microsoft Corporation" would be a link to their website.

Thanks!
Lori
Monday, April 12, 2004
I added a new link template into 0.3.0

var obj = new Active.Controls.Grid;
...
obj.setDataText(function(i, j){return myData[i][j]});
obj.setDataLink(function(i, j){return "http://www.microsoft.com"});
...

var link = new Active.Templates.Link;
link.setAttribute("target", "_new");
obj.setColumnTemplate(link, 1);
...

document.write(obj);
Alex (ActiveWidgets)
Wednesday, April 14, 2004

This topic is archived.


Back to support forum

Forum search