Edit this page

columns.values Array

An array of values that will be displayed instead of the bound value. Each item in the array must have a text and value fields.

Use the values option to display user-friendly text instead of database values.

Example - specify column values

<div id="grid"></div>
  columns: [
    { field: "productName" },
    { field: "category", values: [
      { text: "Beverages", value: 1 },
      { text: "Food", value: 2 }
    ] }
  dataSource: [
    { productName: "Tea", category: 1 },
    { productName: "Ham", category: 2 }

This example displays "Beverages" and "Food" in the "category" column instead of "1" and "2".

Check ForeignKey column for a live demo.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article