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
110
How to bind the dynamic data to dropdown
posted

As the below code when the user click on the row and then the below column change to the drop down and bind the prepared data to listItems.

So how can I get the primary key of the selected row and bind a dynamic data to the listitems? because I need to get the below drop down data based on the selected row Id, I don't need the static data.

 { columnKey: 'ShippingMethod', editorType: 'string', editorOptions: { button: 'dropdown', readOnly: false, listItems: shippings } }

Thanks inadvance

Parents
  • 20255
    Verified Answer
    Offline posted

    Hello,

     Thank you for contacting us!

     I have create you a sample in order to show you this approach, to set combo DataSource depending of the row ID. You will need to set editorType of your column setting to be combo, and to handle editCellStarted event. When start edit a cell the combo will get different DataSource depending of the row ID (you can set other dependency if you like). In the sample I am getting the row primary key with ui.rowID. If you specify primaryKey to the igGrid it will be equal to the ui.rowID value.

     Code snippet:

    1. columnSettings: [
    2.                             {
    3.                                 columnKey: "EmployeeID",
    4.                                 readOnly: true
    5.                             },
    6.                             {
    7.                                 columnKey: "Age",
    8.                                 editorType: "combo",
    9.                                 editorOptions: {}
    10.                             }
    11.                         ]

     If you need further information do not hesitate to contact me!

    DropDownValueParentID.zip
Reply Children
No Data