Hello,
I am using the addItem() function to add an item to the ejDropDownList. This function works fine, except for on the first time adding (when the list is empty). My code is below
$('#teamMemberList').ejDropDownList("addItem", { text: memberName, value: candidateId });
$('#teamMemberList').ejDropDownList("selectItemByValue", candidateId);
This only throws an error when the ejDropDownList is empty. Below is the javascript error I am getting.
Uncaught TypeError: Cannot read property 'push' of undefined
Is there anyway I can add to the dropdown list when it is empty without getting an error?
Thank you