Hello,
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.
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&¶m1'},
{billDate:"2019-11-09", "userName": 'user1&&userId4&¶m1'}
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,
Mykhailo
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.
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: https://jsfiddle.net/flexmonster/nm09d7zh/
Please let us know if this is something you've been looking for.
Regards,
Mykhailo
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?
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: https://jsfiddle.net/flexmonster/nof3pv2t/
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,
Mykhailo
Hi Mykhailo! Thanks for your suggestion, it looks acceptable, but unfortunately 'record Id' is null when we deal with hierarchy. Please have a look for a little modified example.
Sergii,
In this case, you could combine the approaches involving the property
& the id
field types – the property
field can be used for customizing the header cells (members), and the id
field – for the values.
Please see the following sample illustrating this: https://jsfiddle.net/flexmonster/gv7ts0un/
Do you think this will work for you?
Looking forward to your response.
Regards,
Mykhailo
Hi Mykhailo! Thanks again for the suggestion, it is not so elegant as expected, but with additional modifications it works.