Can anyone please help me with that?
Suppose my list name is: Country in which I created 5 folders with different country names, then inside that folder I created their state names.
So scenario is that, first I want to make a dropdown of those country names and then using that dropdown I want to filter and show state name in a Data table (jQuery data table or manually created DataTable).
List screenshot: click to view screenshot
After opening folder it data is in this manner: click to view screenshot
Code Sample:
function getProjectLists() {
// /_api/web/lists/getbytitle('EOT')/items?$select=FileLeafRef,FileRef&$filter=FSObjType eq 1
var url = _spPageContextInfo.webAbsoluteUrl + " /_api/web/lists/getbytitle('EOT')/items?$filter=FSObjType eq 0";
return getAjaxResponse(url).then(function (response) {
hotWorkPermitProjects = response.d.results;
});
}
function getAjaxResponse(url) {
var def = $.Deferred();
return $.ajax({
url: url,
type: "GET",
headers: {
"accept": "application/json; odata=verbose"
},
success: function (response) { def.resolve(response); },
error: function (err) { def.reject(err); }
});
return def.promise();
}