Skip to content

Instantly share code, notes, and snippets.

@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
{
@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;
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();
};
<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"/>