Funk for substring in a kendo grid

#1

I have a kendo grid and in one of the column/fields, I would like to perform substring on the value being provided by the data source.

Basically, I’m trying to do something like this.

 "columns": [
            {
                "id": "id",
                "field": "id",
                "align": "center",
                "label": "Item",
                "width" : 250,
                "sortable": true,
                "link": "/inventoryOptimization/orderDelayRisk/{{id}}",
                "format": {
                      "funk" : "substring",
                      "args" : "[0,10]"
                  }
            }
]

I looked at C3.script.helpers – and did not find a substring function… is there one?

Thanks

Paul

#2

where C3.script.helpers can be found?

#3

c3ui/assets/javascripts/script/Helpers.js

1 Like
#4

Thanks for the help from development. Here is the answer I landed on. I wanted the first 22 characters of the string provided from “id”:

            {
                "id": "id",
                "field": "id",
                "align": "center",
                "label": "Item",
                "width" : 250,
                "sortable": true,
                "link": "/inventoryOptimization/orderDelayRisk/{{id}}",
                "format": {
                      "funk" : "truncate",
                      "args" : [22]
                  }
            },
#5

To check out documentation for UI, you could go to /assets/docs/output/index.htm/

For example, to check out documentation for C3.script.helpers on your environment, you could go https://your-env.c3iot.com/assets/docs/output/index.html#!/api/C3.script.helpers

1 Like