diff --git a/Gruntfile.js b/Gruntfile.js
index fce24bc..bc5384b 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -475,7 +475,7 @@ module.exports = function(grunt) {
},
test : {
src : ['test/**/*.js']
- },
+ }
},
watch : {
@@ -490,7 +490,7 @@ module.exports = function(grunt) {
'test/**/*',
'*.aspx'
],
- tasks : ['build', 'deploy']
+ tasks : ['deploy']
},
test : {
files : '<%= jshint.test.src %>',
@@ -627,7 +627,7 @@ module.exports = function(grunt) {
* BUILD
* Builds the appliation.
*/
- grunt.registerTask('build', "Building Project...", function(){
+ grunt.registerTask('build', "jshint, test, build.", function(){
grunt.log.writeln("BUILD ID: " + buildId);
grunt.log.writeln("BUILD DIR: " + grunt.config(["copy", "build", "dest"]));
@@ -659,7 +659,7 @@ module.exports = function(grunt) {
* copy content from the build folder to the deploy destination.
*
*/
- grunt.registerTask('deploy', ["copy:deploy"]);
+ grunt.registerTask('deploy', ["build", "copy:deploy"]);
grunt.registerTask('test', ["connect:test", "jasmine"]);
diff --git a/documentation/SPWidgets.SPControlBoard.md b/documentation/SPWidgets.SPControlBoard.md
index 6fdbb3e..7e74642 100644
--- a/documentation/SPWidgets.SPControlBoard.md
+++ b/documentation/SPWidgets.SPControlBoard.md
@@ -30,6 +30,7 @@ This method takes as input an object containing the supported options:
CAMLViewFields: '',
fieldFilter: null,
optionalLabel: '(none)',
+ allowFieldBlanks: null,
template: null,
webURL: $().SPServices.SPGetCurrentSite(),
showColPicker: false,
@@ -152,6 +153,13 @@ The default options for this widget can be manipulated/set via the following obj
""
+- **allowFieldBlanks** : *Null|Boolean. Optional. Default=null*
+ Controls whether an additional board state is shown that allows for items to be set to "none", which mean the value store for that Field is blank. By default, the Board widget will attempt to determine the correct behavior based on the Field List definition. Posisble values are:
+
+ - `null` : (Default). Widget will figure it out.
+ - `true` : Always show the "(none)" column. Note that if the field is setup as Required, updates to the item may fail.
+ - `false`: Always hide the "none" column, regardless of the field definition. Note that if your data has item with blanks for the field, those item will not be shown on the board.
+
- **optionalLabel** : *String. Optional. Default="(none)"*
The string to be used as the State column header when field from where Board was built is optional in the List.
diff --git a/src/boardWidget/board.js b/src/boardWidget/board.js
index 8c0d1ac..bab81d4 100644
--- a/src/boardWidget/board.js
+++ b/src/boardWidget/board.js
@@ -53,6 +53,7 @@ define([
CAMLViewFields: '',
fieldFilter: null,
optionalLabel: '(none)',
+ allowFieldBlanks: null,
template: null,
webURL: '',
showColPicker: false,
@@ -91,6 +92,19 @@ define([
* be built from. This field should be either of type
* CHOICE or LOOKUP.
*
+ * @param {Null|Boolean} [options.allowFieldBlanks=null]
+ * Control whether an additional board state is shown that
+ * allows user to move a task to blank value (value in the column
+ * is blank). Possible values are:
+ * `null` - (default) widget will try to
+ * figure it out based on the Field definition in the list.
+ * `true` - Always show "none" column. Note that if the field is
+ * setup as Required, updates to the item may fail.
+ * `false` - Always hide the "none" column, regardless of the
+ * field definition. Note that if your data has item with blanks
+ * for the field, those item will not be shown on the board.
+ *
+ *
* @param {String|Function} [options.CAMLQuery=""]
* String with CAML query to be used against the list
* to filter what is displayed or a function that will
@@ -517,9 +531,13 @@ define([
// store if field is required
if ( f.attr("Required") === "TRUE" ) {
-
opt.isStateRequired = true;
+ }
+ // Override the calculated required state attribute
+ // if user set allowFieldBlanks on input
+ if (typeof opt.allowFieldBlanks === "boolean") {
+ opt.isStateRequired = !opt.allowFieldBlanks;
}
switch(f.attr("Type").toLowerCase()) {