2

When we create a custom build for dojo, it also internalizes the html templates for various widgets into the js file for that widget.

For EnhancedGrid's Filter plugin, the above was not the case till 1.8.0 and was fixed in 1.8.1. I have already written my application using dojo 1.8.0.

Is there any workaround by which I can have the html templates for EnhancedGrid Filter plugin internalized when using dojo 1.8.0

Danubian Sailor
  • 1
  • 38
  • 145
  • 223

1 Answers1

1

There is a simple difference between the uncompressed filter js files of 1.8.0 and 1.8.1, it's this line (for example in FilterBar.js):

"dojo/text!../../templates/FilterBar.html"

If you look at the 1.8.1:

define([
    "dojo/_base/declare",
    "dojo/_base/array",
    "dojo/_base/connect",
    "dojo/_base/lang",
    "dojo/_base/sniff",
    "dojo/_base/event",
    "dojo/_base/html",
    "dojo/_base/window",
    "dojo/query",
    "dijit/_Widget",
    "dijit/_TemplatedMixin",
    "dijit/_WidgetsInTemplateMixin",
    "dojo/fx",
    "dojo/_base/fx",
    "dojo/string",
    "dijit/focus",
    "dojo/text!../../templates/FilterBar.html" // HERE HERE HERE HERE HERE HERE
], function(declare, array, connect, lang, has, event, html, win, query, _Widget,
    _TemplatedMixin, _WidgetsInTemplateMixin, fx, baseFx, string, dijitFocus,
 template){ // HERE HERE HERE HERE - NOTICE THE MAPPING ...

And after that, if you look at the 1.8.0 FilterBar.js:

define("dojox/grid/enhanced/plugins/filter/FilterBar", [
    "dojo/_base/declare",
    "dojo/_base/array",
    "dojo/_base/connect",
    "dojo/_base/lang",
    "dojo/_base/sniff",
    "dojo/_base/event",
    "dojo/_base/html",
    "dojo/_base/window",
    "dojo/cache",
    "dojo/query",
    "dijit/_Widget",
    "dijit/_TemplatedMixin",
    "dijit/_WidgetsInTemplateMixin",
    "dojo/fx",
    "dojo/_base/fx",
    "dojo/string",
    "dijit/focus"
], function(declare, array, connect, lang, has, event, html, win, cache, query, 
    _Widget, _TemplatedMixin, _WidgetsInTemplateMixin, fx, baseFx, 
    string, dijitFocus){...

There is no such line in 1.8.0, so add this lines in the neccessary uncompressed filter js files and create a new build .

You will have to do that for all the html files that are loaded on run-time:

/dojox/grid/enhanced/templates/FilterBar.html
/dojox/grid/enhanced/templates/FilterDefPane.html
/dojox/grid/enhanced/templates/CriteriaBox.html
/dojox/grid/enhanced/templates/FilterBoolValueBox.html

I got this list from your previous question:

Dojo AMD style templates for EnhancedGrid Filter plugin

Community
  • 1
  • 1
Lucian Depold
  • 1,999
  • 2
  • 14
  • 25