Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Customizing values under filter dialog

Sergii Valko asked on October 12, 2020

a similar issue was resolved here but still present under filter dialog. As I’ve mentioned in the related ticket, we have implemented a custom hyperlink generator and a sample of it you can see in the JSFiddle example. As you can see ‘userName’ looks good on the flat form, but if you open filter dialog you will see the original JSON value which contains additional parameters (like userId and some other) for the hyperlink building. Probably concatenating additional parameters to the main value is not a perfect solution, but I can’t found any better for now. We need additional params (time to time more than one) to generate hyperlink, in the provided case we need user name because the same name can be in different users. Any ideas on how to solve this?
Thank you in advance.

5 answers

Mykhailo Halaida Mykhailo Halaida Flexmonster October 15, 2020

Hi Sergii,
Thank you for writing to us and our apologies for the slightly delayed response
Please note that the customizeCell() API call is only applicable to the cells in the grid and cannot be used to modify the filter window members’ selection.
It seems like the most suitable solution here might be preprocessing your JSON before feeding it to Flexmonster. For example, you could split the user-related data into separate fields and then split one JSON entry into separate ones in case there are any one-to-many relationships present.
When applied to your use case, this could involve changing this:

{billDate:"2020-02-05", "userName": 'user1&&userId1&&param1'},
{billDate:"2019-11-09", "userName": 'user1&&userId4&&param1'}

to the following format:

"billDate": "2020-02-05",
"userName": "user1",
"userId": "1",
"userParam": "1"
"billDate": "2019-11-09",
"userName": "user1",
"userId": "4",
"userParam": "1"

Anyway, the approach described above is just one of the potential solutions – feel free to modify it to your needs or use something different in case it does not fully work for you.
We hope this helps.
Best regards,

Sergii Valko 7 days ago

Yes, we definitely can do like you suggest, but in this case, for each cell ‘getMembers()’ should be called to derive params for hyperlink generation (probably performance impact) and the user will see all those additional fields(under drill-through or fields menu) and will be confused. The perfect solution will be the possibility to mark additional fields as hidden or property and have access to it under ‘customizeCell()’ function elsewhere include the drill-through view.

Mykhailo Halaida Mykhailo Halaida Flexmonster 6 days ago

Hi Sergii,
Thank you for further explaining your use case.
With this new info in mind, it seems to us that you might find the property field type helpful – this is simply one of the hierarchy types configurable through the JSON meta-object or the Flexmonster Mapping object.
What it does is allow you to associate a value to a data entry without it being available through the Field List, drill-through, etc. At the same time, the property value can be accessed through the Cell Data Object.
Feel free to check out a sample illustrating this:
Please let us know if this is something you’ve been looking for.

Sergii Valko 1 day ago

Hi Mykhailo,
thank you for the response.
Unfortunately, property cannot be derived under drill-through (but hyperlink should be) in the ‘customizeCell’ function. Or I’m wrong?

Mykhailo Halaida Mykhailo Halaida Flexmonster 20 hours ago

Hi Sergii,
That is correct – a property field cannot be accessed in a drill-through.
I noticed you’ve had a similar discussion with my colleague back in May, where it turned out property didn’t fully suit your use case. Instead, in this thread, an id field type has been suggested – it does not appear as a separate field in the grid, the drill-through, or in the Field List, while also being accessible through the Cell Data object on any level (drill-through included).
With that in mind, have you had a chance to try applying this to your use case?
We’ve put together a quick sample based on the JSFiddle you’re provided earlier to demonstrate the approach we’re suggesting:
In this example, the additional user information (userId & param) is stored in the id type field – it is then used in the customizeCell() function body to generate the necessary links when the user is viewing the grid in flat form or in a drill-through.
Please let us know if this helps.
Best regards,

Please login or Register to Submit Answer