Im confident that this isnt a sharepoint 2007 issue, but id rather cover all of my bases.
I am consulting at a large company, developing a sharepoint solution for their intranet. One of my tasks is to switch the regular dropdownlist in the sharepoint 2007 listview with something that has type ahead and filtering. So i chose a jquery combobox.
Now, in everything but ie6 this combobox works, and the onchange event also works. My process is this:
function diidFilterLinkTitleNoMenuOnChange()
{
FilterField("{9232EB4D-2E5D-40D3-A1C0-818CC21AC839}","LinkTitleNoMenu",this._selOption.value, this.selectedIndex);
}
$(document).ready(function(){
window.dhx_globalImgPath='../_layouts/Intranet.Portal.Custom/PeopleChangesFiles/imgs/';
var y = document.getElementById('diidFilterLinkTitleNoMenu');
if(y != null)
{
$('#diidFilterLinkTitleNoMenu').change(function(){}).attr('onchange',function(){});
var z = dhtmlXComboFromSelect('diidFilterLinkTitleNoMenu');
z.enableFilteringMode(true);
z.attachEvent("onchange",diidFilterLinkTitleNoMenuOnChange);
y.parentNode.removeChild(y);
}
})
I am removing the current onchange event before turning the select list into a combobox, then reassigning a different onchange event.
What is happening as far as i can tell in ie6, is that the old onchange event is still there, still attached, and firing first as it breaks the code and my event doesnt run.
Is there a special way in removing events in ie6? Or am i doing this wrong?
Thats because change() method is a shortcut for
.bind('change', handler). And .bind attaches event handler not removes or overrides.Quote from bind() page:
Use unbind to remove event handlers:
$('#diidFilterLinkTitleNoMenu').unbind('change');