html
3 TopicsLoad predefined data from columns and update field with possible selection with Javascript
I am struggling with piece of code. I am working on SharePoint 2013 and I am trying to set 2 fields fixed when creating a new item in list. All 3 fields are lookup columns, but the red highlighted fields I want to set as fixed and the yellow highlighted field is conditioned by the field Vyberova_Skupina_Sluzba Also Vyberova_Skupina_Sluzba is conditioned by the field Vyber_Oblast I used the part of the code below, the fields are fixed Vyber_Oblast and Vyberova_Skupina_Sluzba but third column is not updated. function nastavSluzba(){ $('#Produktova_Skupina_Sluzba').find('select').val('Hypotekárne úvery'); $('#Vyber_Oblasti').find('select').val('Úverové produkty pre FO') $('#tableNapoveda').remove(); $("#Vyber_Oblasti").find('select').attr("disabled", true); $("#Produktova_Skupina_Sluzba").find('select').attr("disabled", true); $("#Vyber_Oblasti").find('select').css({"background-color": "white","color": "black"}); $("#Produktova_Skupina_Sluzba").find('select').css({"background-color": "white","color": "black"}); var allOptions = document.querySelectorAll("[title=Vyber_Oblasti] option"); [].some.call(allOptions, function(option) { if (option.innerHTML == "Úverové produkty pre FO") { option.selected = "Úverové produkty pre FO"; return true; } }); var allOption = document.querySelectorAll("[title=Produktova_Skupina_Sluzba] option"); [].some.call(allOption, function(option) { if (option.innerHTML == "Hypotekárne úvery") { option.selected = "Hypotekárne úvery"; return true; } }); Can you help me make sure that the third field is loaded automatically and that the user can select an option that falls under Produktova_Skupina_Sluzba ?672Views0likes0CommentsREST API removes HTML markup from plain text MLoT
There is an MLoT field, set as Plain Text (not enhanced not RTF), that is retrieved using REST api ajax call. The data actually contains "< a href="https://... etc">This website< / a >", but when the REST data is returned, the HTML markup tags are removed. So, in the example above only "This website" gets returned. Is it possible to return ALL of the text from the field, without getting the < a > < / a > stripped of it? https://www.easy-bins.com1.1KViews0likes0CommentsCreate webpart that uses MathJax library
I am attempting to create a webpart that will allow me to inject html into a modern page. I have that portion working. I now want to be able to use the MathJax library to insert mathematical formulas into a page. I think I have referenced the library correctly but because the user is allowed to edit the html on the fly, MathJax never does anything with the LaTeX code within the html. I will paste my code here. I am hoping that someone will have an idea of how to get this to work. import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart, IPropertyPaneConfiguration, PropertyPaneTextField } from '@microsoft/sp-webpart-base'; import { escape } from '@microsoft/sp-lodash-subset'; import styles from './HtmlWebPart.module.scss'; import * as strings from 'HtmlWebPartStrings'; import { PropertyFieldCodeEditor, PropertyFieldCodeEditorLanguages } from '@pnp/spfx-property-controls/lib/PropertyFieldCodeEditor'; import * as mathjax from 'mathjax'; export interface IHtmlWebPartProps { description: string; htmlCode: string; } export default class HtmlWebPart extends BaseClientSideWebPart { public render(): void { this.domElement.innerHTML = ` ${ this.properties.htmlCode } `; } protected get dataVersion(): Version { return Version.parse('1.0'); } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: "This web part allows you to enter HTML code directly into a page." }, groups: [ { groupName: strings.BasicGroupName, groupFields: [ PropertyFieldCodeEditor('htmlCode', { label: 'Edit HTML Code', panelTitle: 'Edit HTML Code', initialValue: this.properties.htmlCode, onPropertyChange: this.onPropertyPaneFieldChanged, properties: this.properties, disabled: false, key: 'codeEditorFieldId', language: PropertyFieldCodeEditorLanguages.HTML }) ] } ] } ] }; } }2KViews0likes0Comments