Common container name : DynamicMdmsContainer
Need to form a JSON like below format for Dynamic drop down :-
Example JSON for Trade License - Trade Unit section .
dynamicMdms : { uiFramework: "custom-containers", componentPath: "DynamicMdmsContainer", props: { dropdownFields: [ { key : 'tradeCategory' }, { key : 'tradeType' }, { key : 'tradeSubType', callBack: tradeSubTypeChange, // Optional isDisabled: false , // Optional fieldType : "autosuggest" // Optional } ], moduleName: "TradeLicense", masterName: "TradeType", rootBlockSub : 'tradeUnits', type : 'TL', callBackEdit: updateMdmsDropDowns, isDependency : "DynamicMdms.common-masters.structureTypes.structureSubType" } }
The “dropdownFields” Values are the main picture to manage number of dynamic drop down’s .
In Common container Level Functionality :
First it will trigger API call to get MDMS data Based on Module name and master name after that it will make filter the data based on type ( “TL“ ) .
Once we get response after that this function “
getTransformData
“ will handle to transform to required format .First drop down array of value’s will be auto fill once we get response from MDMS Api and transformed.
Then other drop down array of value’s will be transform based on previous drop down selection .
Note : The values are will save to Dynamic path ( redux path ) based on Module name and MasterName .
Ex :-
`DynamicMdms.${moduleName}.${rootBlockSub}.MdmsJson`
- In this path the API response will save .
`DynamicMdms.${moduleName}.${rootBlockSub}.${rootBlockSub}Transformed`
- In this path the overall Transformed data will save .
`DynamicMdms.${moduleName}.${rootBlockSub}.${key}`
- In this path you can get selected drop down value based on Drop down key which we will get from “dropdownFields” value.
For more functionality please refer this File "dev-packages\egov-ui-framework-core\src\ui-containers\DynamicMdmsContainer\index.js".