Concatenating two fields from the data source into a single KendoGrid Column


What would be the best way to concatenate two fields together in a field for column on the c3ui page? I have tried using the concat function in the field (e.g. “field”: “concat(cells[9].str, cells[0].str)”) and no result appears. Ideally this field would produce an output of the cell value then a ‘/’, then the second field value (e.g. path/filename.csv).



Thanks for posting this here, Todd, after our conversation. I’ll put a bit more context here for other digesters of this discussion and then compose an answer in a subsequent post.

We are working with a KendoGrid here, and we are trying to populate a single column in that KendoGrid with the concatenation of two fields that are returned correctly in our data model (cells[9].str and cells[0].str both return valid strings when projected in their own, independent KendoGrid columns.



in your column definition: use args array and set the funk

"format": {
                  "funk": “getMySpecialCell”,
                  "record" : true,
                  "args": [
                          “field1Column”: “field1Column”,
                          "field2Column": "field2Column"

In ui/content/js/customCode/{ProjectName}Helpers.js add

(function() {
var helpers = C3.script.helpers;
  getMySpecialCell: function(item, fields){
         var field1 = C3.util.getDescendantProp(item, fields[0].field1Column);
         var field2 = C3.util.getDescendantProp(item, fields[0].field2Column);
         return field1 + " " + field2;
1 Like


Use the joinFields helper function as your formatter:

    "id": "dimensions",
    "field": "length",
    "format": {
        "funk": "joinFields",
        "record": true,
        "args": [
            " x "

Just make sure both fields are included in your data source.

1 Like


That looks like a useful funk. Where is joinFields defined and what other ones are available?



With the UI documentation:


closed #7