Right now the number of parameter values a formatter will accept is fixed. This could be improved by allowing the enum type as I am just interested in the value of them.
I have a custom formatter that can accept a dynamic number of values as parameters
Fixed for the end user I mean. Once I set the number of parameters the end user has to stick to those. He can’t add an additional(not optional) value as parameter.
But would that be easy for end user from a UI perspective?
Say I want to concatenate an array with an undefined number of arrays in one go. Not by chaining 15 concat functions
I was thinking that the end user could input in the enum type the arrays he needs(one per enum parameter) and I could pass that undefined number of arrays to the function to concatenate.
var length = arguments.length;
if (!length) {
return [];
}
var args = Array(length - 1),
array = arguments[0],
index = length;
while (index--) {
args[index - 1] = arguments[index];
}
That’s it. I want the end user to be able to pass an undefined number of arrays of values but giving them the option of using the UI and the SC bindings, thus why I though of the enum display type.
fruits = [“banana”, “apple”]
Say user SC function is going to produce these arrays during the execution
At the end they want to concatenate everything so I am creating a formatter for this
fruits.concat(arr1, arr2, arr3, arr4,…,arrN)
So I though lets give them the enum display type so they can bind the value to those arr1…arrN and they can call the keys whatever they want because I just need the values of each pair they add.
Actually I thought that the enum was the grid control(the one in the API actions) due to the description. But now that I think twice about it I know which one it is. Enum is the one for the AC event modifiers, right?
hmm re-reading your array description, seems you don’t need a grid … but just an unlimitted number of arrays as parameters …? not really sure what you are trying to achieve
That is the problem with lodash library. It consists of a mix of pure formatters, but then it has some functions that seem to belong more to a module.
In principle I don’t want to confuse people as to where to find lodash functions (i.e. these are custom formatters and these others are modules so you need to install this here and that there)
If async was a requirement I would have to go through the module route, but lodash is sync so that’s not an issue.
Well with our upcoming data transformations library, we initially went also for formatters and added many array/collections transformations like adding columns, filtering, merging.
But because of the sync working of formatters and the large delay they can have in processing data, we went to implement those as regular modules. So those can be used as action steps.
If you are already working on something like that I can put lodash on hold. I don't want to duplicate options if you are adding something similar to the core.
Hi @George . Can you please share some code on how to configure a grid. I can see the UI being generated, but its a single column, and I can't edit the value either.
I would like to have something like input/query/header guys in API Action.