Skip to content

Instantly share code, notes, and snippets.

<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
<!--
Add Param binding to XLV like so:
<ParameterBinding Name="Organisation" DefaultValue="Technical; Mann Link Business; Directors" />
-->
<!-- import the standard main.xsl, so we have all standard stuff -->
<xsl:import href="/_layouts/xsl/main.xsl"/>
<xsl:output method="html" indent="no"/>
myapp.AddEditCustomer.Customer_render = function (element, contentItem) {
// Write code here.
thatTemplate = '<div><div class="subControl" control="TextBox" data-ls-text="text:{data.ContactName}"></div></div>';
thatControl = new msls.ui.controls.ContentControl($(element));
thatControl.dataTemplate = thatTemplate;
thatControl.data = contentItem.data;
thatControl.render();
};
@joshbooker
joshbooker / Customer.lsml.js
Created December 4, 2014 23:21
Enable Computed Properties by patching OData Read method
/// <reference path="~/GeneratedArtifacts/viewModel.js" />
myapp.Customer.created = function (entity) {
// Write code here.
};
myapp.Customer.CSZ_Compute = function (entity, result) {
// Write code here.
var Me = entity;
@joshbooker
joshbooker / AdventureWorksController.cs
Last active August 29, 2015 14:15
WebAPI OData Sample
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using ODataSample.Models;
namespace ODataSample.Controllers
{
{
"swagger": "2.0",
"info": {
"version": "v1",
"title": "NorthwindAPI"
},
"host": "microsoft-apiapp18a6d483211745969fbbde2fed199d66.azurewebsites.net",
"schemes": [ "https" ],
"consumes": [ ],
"produces": [ ],
/*
https://jsfiddle.net/7tt7fw04/14/
Let's make a function to call RXNorm 'Related' endpoint to get ingredients as seen here:
http://mor.nlm.nih.gov/download/rxnav/RxNormAPIREST.html#uLink=RxNorm_REST_getRelatedByRelationship
The request url: for Plavix (rxcui: 174742) is this:
https://rxnav.nlm.nih.gov/REST/rxcui/174742/related?rela=tradename_of+has_precise_ingredient
// ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------
var helpers = require('../helpers'),
format = require('azure-odata-sql').format,
queries = require('../../../query'),
mssql = require('mssql'),
util = require('util');
module.exports = function (table, item, query) {
{
"swagger": "2.0",
"info": {
"version": "v1",
"title": "NorthwindAPI"
},
"host": "microsoft-apiapp18a6d483211745969fbbde2fed199d66.azurewebsites.net",
"schemes": [
"https"
],
{
"swagger": "2.0",
"info": {
"version": "v1",
"title": "NorthwindAPI2"
},
"host": "services.odata.org",
"schemes": [
"http"
],
public void DeleteSetBaseStatement()
{
var deleteSetStatement = new DeleteSetStatement();
deleteSetStatement.From = new FromClause()
{
Alias = "A",
EntitySet = TestHelper.GetEntitySetRef<Student>()
};