After a little playing about to create drop down selects to filter a sharepoint list (There are many examples on the net) I hacked together my way to acheve a multi select. Partly to stop myself from fogetting and to share with the community, below is a little javascript code + HTML extract to be used in Content Editor Web Part in Sharepoint 2007 for a multiple drop down select:
<script type="text/javascript">
function docLib() {
var docLibUrl = "/sharepoint/testpage.aspx";
var combo1 = document.getElementById("Select1");
var select_val1 = combo1.options[combo1.selectedIndex].value;
var combo2 = document.getElementById("Select2");
var select_val2 = combo2.options[combo2.selectedIndex].value;
var combo3 = document.getElementById("Select3");
var select_val3 = combo3.options[combo3.selectedIndex].value;
var filtercount = 1;
var txt = document.getElementById("Text1");
var filterstring = "";
var filterField = "DocIcon";
var Url_String;
//Need to add filter count based on the number of filters selected
if (select_val1 != "") {
filterstring = "FilterField" + filtercount + "=Business&FilterValue" + filtercount + "=" + select_val1 + "&";
filtercount += 1;
}
if (select_val3 != "") {
filterstring = filterstring + "FilterField" + filtercount + "=Business%5Fx0020%5FOwner&FilterValue" + filtercount + "=" + select_val3 + "&";
filtercount += 1;
}
if (select_val2 != "") {
filterstring = filterstring + "FilterField" + filtercount + "=Status&FilterValue" + filtercount + "=" + select_val2;
filtercount += 1;
}
Url_String = docLibUrl + "?" + filterstring;
document.location = Url_String;
txt.value = Url_String;
}
</script>
<table>
<tr><td>Business:</td>
<td>
<select style="margin:10px; 0px;" id="Select1">
<option value="">--Select--</option>
<option value="FilterVal1.1">FilterVal1.1</option>
<option value="FilterVal1.2">FilterVal1.2</option>
<option value="FilterVal1.3">FilterVal1.3</option>
</select></td>
<td>Status:</td>
<td>
<select style="margin:10px; 0px;" id="Select2">
<option value="">--Select--</option>
<option value="FilterVal2.1">FilterVal2.1</option>
<option value="FilterVal2.2">FilterVal2.2</option>
<option value="FilterVal2.3">FilterVal2.3</option>
</select></td>
<td>Business Owner:</td>
<td>
<select style="margin:10px; 0px;" id="Select3">
<option value="">--Select--</option>
<option value="FilterVal3.1">FilterVal3.1</option>
<option value="FilterVal3.2">FilterVal3.2</option>
<option value="FilterVal3.3">FilterVa31.3</option>
</select></td>
<td>
<input id="Button1" type="button" value="Filter" onClick="docLib();"/></td>
</tr>
</table>
Throwing thoughts, ideas and things not to forget across number of subjects including Software Development, Music, and a bit of Tae Kwon Do every now and again.
Friday, 13 January 2012
Monday, 9 January 2012
Create VHD during install of Win 7/2008
Create VHD using Windows 7/2008 install process
Alternative is (If windows 7 already installed):
1. Create VHD
2. Mount VHD Drive
3. Copy install ISO 7/2008R2 into VHD mounted drive
4. Retart machine and F8 into windows 7 repair
5. From CMD use DISK part to mount VHD Drive
6. CD to mounted VHD drive and run setup
7. Select VHD drive during setup to install to the VHD drive
Finialy the tool to manage vhd images such as size : http://archive.msdn.microsoft.com/vhdtool
- Boot your machine with a blank hard drive using the Windows 7 DVD.
- Click next on the language screen if English is appropriate.
- SHIFT+F10 to launch a WinPE command console. Although the commands below are in upper case, the commands are not case sensitive. I am only using upper case for readability here.
- Enter DISKPART to run the utility.
- LIST DISK to see the available disks in your system. I am assuming a single raw disk.
- SEL DISK 0
- CREATE PARTITION PRIMARY
- FORMAT FS=NTFS QUICK
- LIST VOL
- ASSIGN
- LIST VOL
- CREATE VDISK FILE=c:\windows7rc.vhd MAXIMUM=200000 TYPE=EXPANDABLE
- SELECT VDISK FILE=c:\windows7rc.vhd
- ATTACH VDISK
- CRE PART PRI
- FORMAT FS=NTFS QUICK
- ASSIGN LETTER=V:
- LIST VOL
- LIST VDISK
- exit DISPART
- exit WinPE command console
- Install to the newly created 200GB (fuzzy math) virtual hard disk which looks just like a partition to Windows Setup
- Repeat steps 11-18 for the Windows Server 2008 R2 VHD but with the obvious changes for the vdisk filename, size, etc.
Alternative is (If windows 7 already installed):
1. Create VHD
2. Mount VHD Drive
3. Copy install ISO 7/2008R2 into VHD mounted drive
4. Retart machine and F8 into windows 7 repair
5. From CMD use DISK part to mount VHD Drive
6. CD to mounted VHD drive and run setup
7. Select VHD drive during setup to install to the VHD drive
Finialy the tool to manage vhd images such as size : http://archive.msdn.microsoft.com/vhdtool
Subscribe to:
Posts (Atom)