Coder Social home page Coder Social logo

spwidgettiles's Introduction

SPWidgetTiles - SharePoint 2016 REST API

Commonly, with a workflow intensive process in a SharePoint list, users are left just adding the list to their homepage with a custom view which is static and boring. These tiles work nicely as a dashboard with a query for each tile to display status updates, etc, and keep it fresh. If the data isn't available, the widget collapses, and will be redrawn when it is available. The interval timer is currently set to 5 seconds so that the tiles refresh with current data.

  • @description Queries a SharePoint list and displays the query result in a widget tile.
  • @description Currently accepts $select queries and /ItemCount.
  • @description Use a data attribute of data-count as a boolean to get a filtered count of items.
  • @description e.g. W.queryList(query, heading, widgetid, labelSubs, itemCount, stopRefresh)
  • @description Written in ES5 for IE11 compatability.
  • @author AFEDERICO
  • @todo Test against lookup fields other than a person lookup
  • @requires DIV areas be defined with data attributes. Multiple divs with unique ID's may be used.
<div id="widget1" 
class="widget style4" 
data-heading="My Heading" 
data-labels='{"Title":"From"}'
data-count=false
data-query="../_api/web/lists/getbytitle('List Name')/Items?$filter=Status eq 'Some Status'&$select=id,Title,To/Title,Field_x0020_Name, Qty, Status&$OrderBy=Id desc&$top=1&$expand=To">
</div>

Example use as a function for a button, etc.

W.queryList("<query string>","Widget Name","WidgetID",'{JSON}',@boolean,@boolean);

Note: SharePoint's lookup fields return asynchronously, which affects field load order. In order to keep the ID at the top, adjustments were made to element rendering.

Screenshots

(Side by side to show automatic refresh)

All Queries Successful

All Queries

Missing Query Result

Missing Query Result

Recreate Tile From Query Result

Recreate Tile From Query Result

Script Snippet

Script Snippet

spwidgettiles's People

Contributors

afedericojr avatar

Stargazers

 avatar Jason White avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.