martedì 8 settembre 2020

Sharepoint - Metodi, Oggetti e variabili utili in Javascript

 Sharepoint, oltre all'ottimo Object Model Server-side, ha anche un object model client side (JSOM) e tante utilità in javascript. Le funzioni principali sono contenute nei due file core.js e init.js. Per una esauriente spiegazione vedere questo articolo.  Qui sotto riporto un semplice elenco delle funzioni disponibili (purtroppo poco documentate)

Init.js (Function)
  • ULSTrim(str)
  • ULSEncodeXML(str)
  • PageUrlValidation(url)j GetCurrentEltStyle(element, cssStyle)
  • IsCheckBoxListSelected(checkboxlist)
  • STSHtmlEncode(str)
  • DeleteCookie(sName)
  • GetCookie(sName)
  • navigateMailToLink(strBody)
  • navigateMailToLinkWithMessage(strTo, strBody)
  • makeAbsUrl(strUrl)
  • HideMenuControl(menuControlId)
  • displayPNGImage(id,src,width,height,alt)
  • GetUrlKeyValue(keyName, bNoDecode, url)
  • GoToPage(url)
  • TrimSpaces( str )
  • TrimWhiteSpaces( str )
  • FormatDate(sDate, sTime, eDate, eTime)
  • GetElementByClassName(elem, classname)
  • WpClick(evt)
  • GetViewportHeight()
  • GetViewportWidth()
  • RemoveQueryParameterFromUrl(stURL, stParameterName)
  • HasValidUrlPrefix(url)
  • AbsLeft(obj)
  • AbsTop(obj)
  • ExecuteOrDelayUntilScriptLoaded(func, depScriptFileName)
  • ShowPopupDialog(dlgUrl)

core.js(Function)
  • NewItem(url)
  • EditItem(url)
  • RefreshPageTo(evt, url, bForceSubmit)
  • PopMenuFromChevron(e)
  • RefreshPage(dialogResult)
  • OpenPopUpPage(url, callback, width, height)
  • OnIframeLoad()
  • RemoveUrlKeyValue(keyName, url)
  • RemoveParametersFromUrl(url)
  • _GoToPageRelative(url)
  • ShowInPopUI(evt, currentCtx, strUrl)
  • OpenPopUpPageWithTitle(url, callback, width, height,title)
  • AddSourceToUrl(url)
  • ConvertMultiColumnValueToString(subColumnValues,delimiter,bAddLeadingTailingDelimiter)
  • Log(str)
  • CountTotalItems(ctxCur)
  • CountSelectedItems(ctxCur)
  • _addNotificationInternal(span, strHtml, bSticky, tooltip, onclickHandler, bNoAnimate)
  • removeNotification(id, bNoAnimate)
  • SetCookie(name, value, path)

Nessun commento:

Posta un commento