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
250
Angular 2 IGGrid Combo dialog edit mode binding
posted

Hi,

I have problem binding the data that's coming back from the API to the combo inside iggrid dialog edit mode.

I tried to bind it during editRowStarted but it wipe out my selection if i didn't select anything. Please find my sample attached

Thanks

editRowStarted: function (evt, ui) {
var editor = $("#TestTypeGrid").igGridUpdating("editorForKey", "userId");
if (editor) {
editor.igCombo("option", "dataSource", me.users);
editor.igCombo("dataBind");
}
},

home.zip
Parents
  • 3995
    Offline posted

    Hello,

    The approach with the editRowStarted is correct!

    The problem there is, that there is no actual value for combo set. And calling dataBind simply displays the first one.

    Also setting new dataSource does not require dataBind. You have to set the value of the igCombo.

    All you need should modifying a bit editRowStarted to:

    editRowStarted: function (evt, ui) {
     let editor = $("#TestTypeGrid").igGridUpdating("editorForKey", "userId");
     if (editor) {
      let record = ui.owner.element.igGrid("findRecordByKey", ui.rowID);
      editor.igCombo("option", "dataSource", me.users);
      editor.igCombo("value", record.userId);
     }
    },

    Let me know if you have further questions.

Reply Children