Change Attribute Table widget's column width by field name

985
2
08-13-2020 04:17 AM
DávidGregor
New Contributor II

I would modify the column width to get  automatically resized to content, what is maybe too much. But  a hardcoded (specify field names) version would be better. Just i cannot find my way to the columns creation.

Any idea to stop long string's breakings in the cells?

This code is just theoretical:

aspect.around(this.grid, "renderColumns", function(original) {
return function(object) {
var column = original.apply(this, arguments);
console.log(columns);
if(object['SDE.TABLE.FIELD']){
console.log('found');//object is the row data object so change the field name to your own
html.addClass(columns, 'wideColumn');
}
return columns;
};
});
console.log("run");
this.grid.refresh();

style:

.wideColumn {

width:400px !important;

}

0 Kudos
2 Replies
DávidGregor
New Contributor II

Totally hardcoded option:  add this to the AT widget's style.ccs:

the number is your cloumn

.dgrid-column-field3{
  width500px !important;
}
0 Kudos
DávidGregor
New Contributor II

in _FeatureTable.js  you can console.log(header)

and you can see the classes of your headers, so you can be more specific in the css.

like this:

capital letters are sample values for the scheme.

.field-SDE-TABLE-FIELD{
  width600px!important;
}
0 Kudos