Freezing rows / header row

Now I’ve got it going I was hoping I could either freeze the top row so it always shows or add headers to the frame. The searches turned up results that where about 5 years old for Grid so I’m not sure if these still apply to spreadsheet or not. As always your time and patience is much appreciated.

unfortunately freezeing rows is not available.
Byt you may change text of header cells by double click.

That my friend is a perfect answer :slight_smile:. Is there any way to set up the headers through the code rather than double clicking (I tend to have batches of similar spreadsheets).

By the way I was right when I said this was exactly what I had been looking for. It’s pure genius!

Try to use:

dhx_sh.saveHeadCell(1, "Column name");

first parameter is a column number (starting from zero).
But the new header will appear only after page reloading.

By the way, thanks for your feedback :slight_smile:

Remembering I’m an idiot what file does that drop into? spreadsheet.php?

No problem re feedback. I’ve still to keep looking at a lot more of the stuff it seems it can do so no doubt I’ll be back for more help along the way.

Have you any plans to add any more functions? If so can I add if, count and sumif to the list? Just pushing my luck now lol.

It’s a javascript code, so you may place it somewhere at your html-page in tag.

Ah right. I was thinking it had to go in one of the js files that would have done it. But that’s far more flexible for me. Great. Thanks again.

Sorry to be a pest. Can you give me a short example please as I can’t get this working at all.

here is a sample of my code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<script src="../codebase/spreadsheet.php"></script>
    window.setTimeout(function() {
        dhx_sh.saveHeadCell(1, "Column name 1");
        dhx_sh.saveHeadCell(2, "Column name 2");
    }, 1000);

You should use setTimeout to wait while spreadsheet is initialized and loaded. After that this code will set header names. Then remove this code and refresh a page.

Got it all working like a charm now. Thanks. That will make my life a whole lot easier. :smiley: