Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
Pass multiple columns to igCombo textKey property
posted

Here is the thing. I have and igCombo in which I want to display more than one column values.

Suppose these are my columns

columns: [
                    { headerText: "Baureihe", key: "ModelRange", dataType: "string" },
                    { headerText: "ShortCut", key: "ShortCut", dataType: "string" },
                    { headerText: "", key: "Idx", dataType: "number", hidden: true }
                ],

And here is the code for Combo

$id.igCombo({
                dataSource: comboData,
                autoSelectFirstMatch: false,
                valueKey: "Idx",
                textKey: "ModelRange"
            });

What I want to do is this (textKey: ModelRange, ShortCut)

How can this be achieved?

  • 20255
    Offline posted

    Hello,

    Thank you for contacting us.

    Possible way would be to use itemTemplate. Code snippet:

    $("#combo").igCombo({
      valueKey: "Name",
      textKey: "Name", 
      width: "300px",
      dataSource: adventureWorks,
      itemTemplate: "<span>${Name}</span> <span>${ProductNumber}</span>"
    });