SPWidgets v2.2 – What’s New?

Had some time to roll out some more changes to SPWidgets, including a new Widget.  Here is what’s new with Version 2.2:

(New) Date Widget – SPDateField

This new widget is rather simple and for the most part, it is a wrapper around jQuery UI Datepicker. The widget binds on to an HTML input field and displays a Datepicker. The benefit of using this widget instead of jQuery UI Datepicker directly is:

  1. Input field stores selected date(s) in the format expected by SharePoint API (ISO 8601, YYYY-MM-DD)
  2. User visible date is displayed using readable format (ex. mm/dd/yyyy)
  3. Support for selecting multiple dates
  4. Support for also defining Time (something jQuery UI does not provide)
  5. Like other widgets, it is localizable and and configurable

spwidgets.date

To use it, simply call SPDateField() on an input field and the widget is inserted into the place where the input is located on the page.

$("input").SPDateField();

The actual input used when this widget is called is hidden and replaced with the UI displayed above, which uses the Datepicker and optionally the Timepicker. The dates selected will be stored using the format expected by SharePoint API (ie WebServices) – ISO 8601 (ex. 2013-09-02T17:05).

For more on its usage, checkout the documentation or the Demo Single Page Application (SPA) which has been updated to showcase this widget.  The SPFilterPanel widget was also enhanced to display the Date and Time fields using this new widget.

Upload Widget – Refactored

The Upload widget has also been refactored and is now supported on SharePoint 2013. The look and feel of the widget was improved to fall inline with some of the more recent widgets, Additional input options were also added to make it easier for developers to integrate it in applications.

The widget remains compatible with SharePoint 2007 and 2010 and currently works only on Document Libraries, including those that may have Check In turned on.

Here is a short video of this plugin in action on the Demo Application page:

(New) ISO 8601 Date Parsing – parseDateString

In working with the new Date widgets it quickly became apparent that I needed a common method to parse ISO 8601 dates.  SPWidgets already has a utility that can generate ISO 8601 date string.  This utility takes as input a String representing the ISO 8601 date and return a Date object.

For more on this utility, see the document page.

Enhancements to the Filter Panel Widget

The filter panel widget, one of the most used widgets by me, has received the following enhancements:

  1. Date and Time fields now leverage the new Date widget
  2. Each column now has an option to match ALL or ANY of the values entered (use of logical AND or OR)
  3. Lookup fields now leverage the new picker from the SPWidget Lookup field

Head over to github to download the latest – purtuga.github.io/SPWidgets

Advertisements

3 thoughts on “SPWidgets v2.2 – What’s New?

    1. Hi Greg.
      It doesn’t. The filter panel only gives you the CAML filter based in the user’s input. Your code would then have to build the actual query against the List, and likely add the other “stuff” like sorting, viewfields and rowlimit, etc.
      Does that make sense? Take a look at the showcase page and specifically the working example for this widget.

      Paul

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s