Apertura BCE reimposta personalizzato href delle voci di elenco
Domanda
Una volta che una pagina termina il caricamento, io uso JQuery per cambiare href ogni elemento basato su alcuni di validazione personalizzati.Finora tutto bene, ma il mio problema è che l'apertura della BCE reset href dell'elemento.Ho una funzione per modificare il link e vorrei chiamarlo, dopo che la BCE finito di modificare il href ripristinare i cambiamenti che la BCE non.Dove vorresti essere tale luogo?
Codice per modificare il link:
function changeLinks() {
$(document).ready(function () {
$("div.ms-vb.itx").each(function () {
var itemid = $(this).attr("id");
isValid = aktiverWF[itemid] == "0" || aktiverWF[itemid] == "1";
if(!isValid)
{
$(this).find("a").removeAttr("onclick");
$(this).find("a").unbind("click");
$(this).find("a").attr({ href: "javascript:alert('Gewählte Aktion ist nicht durchführbar, da ein Workflow aktiv ist.');" });
}
});
});
}
Soluzione
Finalmente trovato un modo per continuare a href com'era prima dell'apertura della BCE.Succede tutto nel CreateAjaxMenu(e)
funzione.Codice di mantenere le modifiche (con commento in cui sono state apportate modifiche) per la normale funzione da core.js:
CreateAjaxMenu = function(e)
{ULSrLq:;
if (!IsContextSet())
return;
if (e==null)
e=window.event;
if (itemTable==null && ecbElm !=null)
itemTable=ecbElm;
var srcElement=e.srcElement ? e.srcElement : e.target;
if (itemTable==null || (itemTable.tagName=="TABLE" && imageCell==null) ||
(onKeyPress==false && !IsInCtxImg(srcElement) &&
(srcElement.tagName=="A" ||
srcElement.parentNode.tagName=="A")))
return;
var itab=itemTable;
var p=itab.parentNode;
if (p !=null && p.getAttribute('creatingAjax')==1)
return;
itab.parentNode.setAttribute('creatingAjax', '1');
var ctx=currentCtx;
var fn=function(ctx, tab)
{ULSrLq:;
itab.parentNode.replaceChild(tab, itab);
tab.onclick=itab.onclick;
tab.onmousehover=OnItem;
tab.innerHTML = itab.innerHTML; // this line keeps the inner html and thus the old href
OnItemDeferCall(tab);
CreateMenuEx(ctx, tab, null);
tab.parentNode.removeAttribute('creatingAjax');
};
FetchEcbInfo(ctx, itemTable.id, itemTable.tagName, fn);
e.cancelBubble=true;
return false;
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange