dhtmlxGrid column attribute

Hello ,

Is it possible to set an attribute to a specific column ?
and if so , how ?

Thanks.

No, it not possible. You can set attributes only for cells and rows.

Does that mean, if I am about to create a new excell type, eg. “expandable”, which hides the cell’s text after 200 character and displays a “show more” / “show less” button, I need to hardcode the number 200 in javascript? I would like to achieve something like this:

Description

in my excell definition I would need to do:

var sliceAt = some accessor method on grid to retrieve current cell’s column’s attributes;
this.setCValue(cellValue.slice(0, sliceAt));

I guess its possible, as the combo excell uses custom attributes like xmlcontent and editable.

I wouldn’t like to do things like: Some really long text^250

Clearly, its not the cell’s responsibility to know about when to truncate. It applies to the whole column itself, not to individual cells.

Thanks,

David

For future reference: I ended up adding the attribute to the cell:

XML column definition:

<column id="Description" type="expandable" sort="str" width="*" align="left">Description</column>

Cell definition:

<cell slice-at="100">Some really long description..</cell>

In eXcell_expandable:

var sliceAt = this.cell._attrs['slice-at'] || 200;