EloquentStudio / filter.js

Complete solution for client side filtering and rendering using JSON data
http://eloquentstudio.github.io/filter.js
MIT License
664 stars 183 forks source link

Error while generating getter function for selector #178

Open btnevan opened 5 years ago

btnevan commented 5 years ago

I am getting this error in my console:

Error while generating getter function for selector : portal.fields.fields.fieldId NOTE: Define manually

I need to find a way to use that data, but do not know how to "define manually" as suggested by the error.

The JSON is presented in the following format (I have no way of changing this nesting)

{
    "items": [
        {
            "id": 123456,
            "portal": {
                "fields": [
                    {
                        "fieldId": 100001,
                        "fieldName": "CategoryA",
                        "valueId": 123456,
                        "value": "ValueX",
                        "fields": [
                            {
                                "fieldId": 200001,
                                "fieldName": "SubCategoryA",
                                "valueId": 123459,
                                "value": "SubValueA"
                            }
                        ]
                    },
                    {
                        "fieldId": 100002,
                        "fieldName": "CategoryB",
                        "valueId": 123457,
                        "value": "ValueY"
                    },
                    {
                        "fieldId": 100003,
                        "fieldName": "CategoryC",
                        "valueId": 123458,
                        "value": "ValueZ"
                    }
                ]
            },
            "date": "2019-02-11"
        }
    ],
    "totalCount": 1
}   

I simply need to display the value of each object (in this example, ValueX, ValueY, ValueZ, and SubValueA) . The other keys-value pairs of fieldId, fieldName, and valueId are not important for my implementation.

Can you please provide some assistance.