I figured this would work
$( this.gridIDMap.option( "columns" ) )[c].format = "#.###";
my column remains the same, do I need to refresh something?
well in my case the data comes in from JSON, and I cant really mess with adding columns. Very interesting work around though.
I don't know about changing the format after initialization. I haven't seen a way to do that.
As an alternative, you could create an unbound column that uses a formula and has the format you want.
Then hide your other column and use the unbound column.
Set your columns similar to this when setting up your grid:
{ headerText: "MyField", key: "MyField", dataType: "number", format: "###.#######", hidden: true},
{ headerText: "MyFormattedField", key: "MyFormattedField", dataType: "number", unbound: true, format: "#.###", formula: formatMyField, width: 70 }
Then in a javascript function:
function formatMyField(data, grid) {
return data["MyField"];
}
Then you can hide and show columns with the following:
$(
"#YourGrid"
).igGrid(
"hideColumn"
,
"MyField"
);
$("#YourGrid").igGrid("showColumn", "MyFormattedField");
"showColumn"
"MyFormattedField"