Need a special offer?Find out if your project fits.
+

How to get a column type with using ElasticSearch data source with Typescript+flexmonster types?

Answered
uchivoitachi asked on July 31, 2021

Hi Team,
 
We've encounterred a weird issue regarding the column type, we using Typescript + React + flexmonster types,and figured out that it seems unable to get the column type(seems missing property "type" in both hierarch and measures.
 
Please be aware of that this issue won't happen if not use flexmonster types.
 
In my package.json:
"devDependencies": {
   "react-flexmonster": "2.9.3",
    "flexmonster": "2.9.3",
  }
 
How to use flexmonster in react page:
import {Pivot} from "react-flexmonster";
return(
        <Pivot
            toolbar={true}
            ref={ref}
            width={"100%"}
            height={"100%"}
            ready={onReady}
            beforetoolbarcreated={customizeToolbar}
            customizeContextMenu={customContextMenu}
        />
    )
 
Use getAllHierarchies() to get all current hierarchies,and found that the Hierarchy object missing property "type":
 
flexmonster.d.ts:
getAllHierarchies(): Hierarchy[];
interface Hierarchy {
        caption?: string;
        dimensionCaption?: string;
        dimensionUniqueName?: string;
        folder?: string;
        label?: string[];
        levels?: Level[];
        sort?: string;
        uniqueName?: string;
    }
 
however, if not use flexmonster types,the "type" property will be shown.
 
May we want to know how to get the column type correctly when using React + Typescript + flexmonter.d.ts types?
 
And at last we want to tell that the datasource is from Elasticsearch, not sure if this is will impact the Hierarchy object.

5 answers

Public
Vera Didenko Vera Didenko Flexmonster August 2, 2021

Hello,
 
Thank you for writing to us.
 
The hierarchy's "type" property was intended for CSV/JSON data sources. Currently for Elasticsearch data source type, Flexmonster doesn't return the "type" property.
Could you please let us know what you are trying to achieve with the "type" property? There could be another solution.
 
Looking forward to your response.
 
Kind regards,
Vera

Public
uchivoitachi August 4, 2021

Hi Team,
 
Thanks for the reply.
 
We want to add a context menu via API Call(customizeContextMenu),this new menu is for the date type column only,so it's a must to get the column type correctly.

Public
Vera Didenko Vera Didenko Flexmonster August 4, 2021

Hello,
 
Thank you for providing further details.
 
Our team could provide an update so that the type property is returned for Elasticsearch as well.
This will be available in an upcoming minor release with the ETA 26th of August.
 
Please let us know if this would work fine for you.
 
Kind regards,
Vera

Public
Vera Didenko Vera Didenko Flexmonster August 24, 2021

Hello,
 
We are happy to inform you that now "type" property is also returned for getAllHierarchies() and getAllMeasures() API calls when using Elasticsearch.
 
This is available in the latest (v2.9.6) version of Flexmonster: https://www.flexmonster.com/release-notes/.
You are welcome to update the component. Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
 
Please let us know if the update works fine for you.
 
Kind regards,
Vera

Public
Vera Didenko Vera Didenko Flexmonster September 6, 2021

Hello,
 
Our team is wondering if you had a chance to check out the new update.
Does the "type" property work fine for you?
 
We are looking forward to your feedback.
 
Kind regards,
Vera

Please login or Register to Submit Answer