here i have one dropdown inside gridview
My question is i want to bind data inside dropdown using client context or csom
i am using developer site for App developement and list also in thesee
bind that productname colum
thank u advance
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
satish babuPosted Aug 28, 2014, 3:29 AM
function displayLists() {
// Get the available SharePoint lists, and then set them into
// the context.
lists = web.get_lists();
context.load(lists);
context.executeQueryAsync(onGetListsSuccess, onGetListsFail);
}
function onGetListsSuccess(sender, args) {
// Success getting the lists. Set references to the list
// elements and the list of available lists.
var listEnumerator = lists.getEnumerator();
var selectListBox = document.getElementById("selectlistbox");
if (selectListBox.hasChildNodes()) {
while (selectListBox.childNodes.length >= 1) {
selectListBox.removeChild(selectListBox.firstChild);
}
}
// Traverse the elements of the collection, and load the name of
// each list into the dropdown list box.
while (listEnumerator.moveNext()) {
var selectOption = document.createElement("option");
selectOption.value = listEnumerator.get_current().get_title();
selectOption.innerHTML = listEnumerator.get_current().get_title();
selectListBox.appendChild(selectOption);
}
}