:: Forum >>

multiply cell indicators

Hi,
in the indicator-template example it only show one cell.

How do you create multiply indicators. eg. if I want to have a cell-indicator on 1,1 & 1,2 etc how it it acheived.?

As you can see I'm very new to ActiveWidgets.

Thanks for any help/advise on this subject.
Colin
Tuesday, April 22, 2008
Pay close attention to the comment above this line in Alex's example -
// show for cell 1-1
obj.setCellIndicator(true, 1, 1)
Anthony
Tuesday, April 22, 2008
Hi Anthony,
Thanks for the quick reply but I think I didn't make myself clear. I would like to have a indicator-template on variuos cell's each having a different comment when selected/clicked. In the example the reply sent back each time is the same regardless of which cell is selected.

I have tried doing the following
// show for cell 1-1
obj.setCellIndicator(true, 1, 1);
// show for cell 1-2
obj.setCellIndicator(true, 1, 2);

but they both return the same.
eg.
"Cell indicator - 1 1" or "Cell indicator - 1 2"

Does this make sence.?

Thanks
Colin
Tuesday, April 22, 2008
Yes, perfectly. The pup-up comes from this alert call in Alex's example -
obj.onCellIndicatorClicked = function(event, col, row){
alert("Cell indicator - " + col + " " + row)}

You would need to replace the alert() call with whatever you wish to have. And that will get very complicated very quickly.

From what I can tell of Alex's example, while this tries to mimic Excel, it doesn't do so completely. You can't, for example, add a new indicator interactively as you can in Excel and type in some comments.

You would need to write a lot more code to do that. So, something like detect a right or shift or control click, pop up a panel (a DIV would be the easiest) with a textpane in it. Then store that somehow when the pop-up is closed.

If you're familiar with JavaScript and HTML, its doable. If not, you'll be spending a very long time on this.
Anthony
Tuesday, April 22, 2008
You also need to replace the default Template with the one custom defined "MyTemplate" for every column you are planning to use cells-indicators.
Like in the sample:

// our new template for col-1
obj.setCellTemplate(new MyTemplate, 1);

Or do it for the whole grid:

// our new template for all columns in grid
obj.setCellTemplate(new MyTemplate);

Wednesday, April 23, 2008

This topic is archived.


Back to support forum

Forum search