Renaming Grid Column Title

I tried this and none of it works. Sorry for cluttering your thread.

Anyway, this function indeed executes, but gridModel.columns is not in context when it does.

You could overwrite the gridModel.columns array entirely but getting the existing columns array using expression language seems impossible.

You could also explore the SaveLayout REST method (like when users personalize)

Best of luck,
Josh

More info:

Learned a lot about the classes involved including MetaFxPropertSetEvent, MetaFxEventParamService, MetaFxComponentService, MetaFxDynamicFunctionService, and gridService. Hope to share sometime.

The crux on property-set is:

  1. Property name is static text - not evaluated, only Value is evaluated using expression syntax.
  2. components are not in scope on js eval only the following are passed: (context, transactionService, session, user)

I tried

~_myGrid.gridModel.columns_~

which triggers the component expression parser but it requires the format componentID.propertyName, is limited to top level properties only, and returns only strings (no objects, no arrays of obj). So even if it parsed, it would return [object object].

too bad they didn’t include JSON.stringify and JSON.parse in the expression parsers.

1 Like