The .replace() calls in compileFilter() and compileFilterWithCaching() (slick.dataview.js) fail to replace the return true and return false statements in the user-defined filter function if the user-defined filter function is in a script file that has been bundled by ASP.NET Bundling and Minifcation (System.Web.Optimization).
Reason: ASP.NET replaces return true with return!0 and return false with return!1 (this happens even if you call BundleTable.Transforms.Clear(), so possibly part of Bundling routine rather than Minification routine).
Confirmed workarounds:
1) options.inlineFilters = false (to avoid using compiled filters altogether)
2) Do not use ASP.NET B&M for the file with the filter function, OR
3) Modify slick.dataview.js to handle the special cases for return values.
Suggested fix:
I considered doing a fork&pull request, but not sure if support for "ASP.NET bundling" is a goal of this project (though it seems that there was already a fix to compileFilter() to handle JS compression method used by Google).
The
.replace()
calls incompileFilter()
andcompileFilterWithCaching()
(slick.dataview.js
) fail to replace thereturn true
andreturn false
statements in the user-defined filter function if the user-defined filter function is in a script file that has been bundled by ASP.NET Bundling and Minifcation (System.Web.Optimization).Reason: ASP.NET replaces
return true
withreturn!0
andreturn false
withreturn!1
(this happens even if you callBundleTable.Transforms.Clear()
, so possibly part of Bundling routine rather than Minification routine).Confirmed workarounds: 1)
options.inlineFilters = false
(to avoid using compiled filters altogether) 2) Do not use ASP.NET B&M for the file with the filter function, OR 3) Modify slick.dataview.js to handle the special cases for return values.Suggested fix: I considered doing a fork&pull request, but not sure if support for "ASP.NET bundling" is a goal of this project (though it seems that there was already a fix to
compileFilter()
to handle JS compression method used by Google).Related StackOverflow question: http://stackoverflow.com/questions/27702628/script-minified-with-bundling-dont-work-in-asp-net-mvc-3-when-debugging-is-disa