I am using the following code to make a button that consists of VF pages as a dropdown list and a filter criteria button for searching various properties along with pages:
<div id="vp_page_dd">
<span></span>
<button type="button" id="btnSort" >
<table width="100%">
<tr>
<td width="81%" id="BtnDropDown_test">
<select id= "VFPageListsDropDown123" class="menuDropDown"> </select>
</td>
<td width="19%"> <span class="caret"></span></td>
</tr>
</table>
</button>
<span>
<!-- <div id="dropdowns-1" class="dropdowns dropdowns-tip">
<ul class="dropdowns-menu" id="VFPageListsDropDown"></ul>
</div> -->
</span>
</div>
<!-- SELECT VISUAL FORCE PAGE DROP DOWN Ends -->
<!-- Fillter Criteria Starts -->
<div id="div_FilterCriteria" align="right">
<button type="button" class="btn-sample" onclick="showPopUpModalForFilterCriteria()">Filter Criteria</button>
</div>
<!-- Criteria -->
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" width="100%" >
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" id="titlePopup1" >
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<center>
<!-- put content of the pop up window ... -->
<div class="dt-example" >
<div id="filterCriteria" style="overflow:auto">
<table>
<tr>
<td style="width:25%;"></td>
<td style="width:70%;">
<b>Filter Criteria: </b>
<select id="mainSelect" class="mainSelectDropDown" align="left">
<option value="Pages" >Pages</option>
<option value="webservices" >WebServices</option>
<option value="batch" >Batch</option>
<option value="complexcity" >Complexcity</option>
</select>
<br/><br/>
<b>Fillter Values: </b>
<select id="filterSubSelect" class="subSelectDropDown" align="left">
</select>
</td>
Below are the functions for the purpose of page search for the filter criteria button:
$('#mainSelect').change(function(){
$('#filterSubSelect').html('');
var selectedOption= $('#mainSelect').val();
if(selectedOption==="Pages"){
getPages();
}else{
getobjects();
}
});
/* 'Select Visual Force Pages' DROP DOWN - click on it will */
$('#filterSubSelect').change(function() {
console.log("sub filter changed");
var selectedMainOption= $('#mainSelect').val();
var selectedSubOption= $( "#filterSubSelect option:selected" ).text();
console.log("selectedSubOption::"+selectedSubOption);
if(selectedMainOption==="Pages"){
var selectedVFPage=selectedSubOption;
setSelectedVFPageActive(selectedVFPage);
console.log("changed one drop down to: " + document.getElementById('SelectedVFPageActive').value); //VFPageListsDropDown
console.log(" inside drop down click(): " + jsonfileURL);
getOneVFpage(jsonfileURL, selectedVFPage);
}else{
}
setSelectedVFPage function:
function setSelectedVFPageActive(selectedVFPage) {
document.getElementById("SelectedVFPageActive").value = selectedVFPage;
console.log("current Active VF page set to 2 (setSelectedVFPageActive) : " + document.getElementById("SelectedVFPageActive").value);
return selectedVFPage;
What I want is a similar function for the id='VFPageListsDropDown123'.I have tried to write the function in the same way as the above written two functions, so that when I select a page from the dropdown list, it comes to display,but it is not happening.Can anyone tell how to write the function?
Aucun commentaire:
Enregistrer un commentaire