用于EnhancedGrid Filter插件的Dojo AMD样式模板 [英] Dojo AMD style templates for EnhancedGrid Filter plugin

查看:204
本文介绍了用于EnhancedGrid Filter插件的Dojo AMD样式模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有Filter插件的增强型网格,如下所示:

I have an Enhanced grid with Filter plugin as shown below:

<!DOCTYPE html>
<html >
<head>


    <style type="text/css">@import "./dojo/resources/dojo.css";
@import "./dojox/grid/enhanced/resources/claro/EnhancedGrid.css";
@import "./dojox/grid/enhanced/resources/EnhancedGrid_rtl.css";

/*Grid need a explicit width/height by default*/
#grid {
    width: 45em;
    height: 20em;
}</style>
<script data-dojo-config="async: true" src='./dojo/dojo.js'></script>
<script data-dojo-config="async: true" src='./dojo/mydojo.js'></script>
<script>



var dojoConfig = {
    baseUrl: "./",
    tlmSiblingOfDojo: false,
    packages: [
        { name: "dojo", location: "dojo" },
        { name: "dijit", location: "dijit" },
        { name: "dojox", location: "dojox" }
    ]
};



require(["dojox/grid/EnhancedGrid","dojo/data/ItemFileWriteStore",
"dojox/grid/enhanced/plugins/Filter"], 
function(EnhancedGrid,ItemFileWriteStore,Filter){
        /*set up data store*/
        var data = {
          identifier: 'id',
          items: []
        };
        var data_list = [
          { col1: "normal", col2: false, 
col3: 'But are not followed by two hexadecimal', col4: 29.91},
          { col1: "important", col2: false,
 col3: 'Because a % sign always indicates', col4: 9.33},
          { col1: "important", col2: false, 
col3: 'Signs can be selectively', col4: 19.34}
        ];
        var rows = 60;
        for(var i=0, l=data_list.length; i<rows; i++){
          data.items.push(dojo.mixin({ id: i+1 }, data_list[i%l]));
        }
        var store = ItemFileWriteStore({data: data});

        /*set up layout*/
        var layout = [[
          {'name': 'Column 1', 'field': 'id'},
          {'name': 'Column 2', 'field': 'col2'},
          {'name': 'Column 3', 'field': 'col3', 'width': '230px'},
          {'name': 'Column 4', 'field': 'col4', 'width': '230px'}
    ]];

        /*create a new grid:*/
        var grid = EnhancedGrid({
            id: 'grid',
            store: store,
            structure: layout,
            rowSelector: '20px',
                plugins: {
                   filter: {
                    closeFilterbarButton: true,
                    ruleCount: 5,
                    itemsName: "songs"
                   }
                }
         },  "gridDiv");

        /*append the new grid to the div*/
       // dojo.byId("gridDiv").appendChild(grid.domNode);

        /*Call startup() to render the grid*/
    grid.startup();
    //alert("ee");
    //grid.placeAt("gridDiv");
});

</script>
</head>
<body class="claro">
<div id="gridDiv"></div>
</body>
</html>

当我调用上述HTML时,我看到一些与要下载的Filter plugin相关的html文件包括:

When I invoke the above HTML, I see a number of html files related to Filter plugin being downloaded which include:

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

我希望这些文件成为EnhancedGrid的Javascript的一部分。到目前为止,我发现了以下解决方案:

I want these files to become part of the EnhancedGrid's Javascript. So far I have found the following solution:

http://grokbase.com/t/dojo/dojo-interest/11bs5jf64d/custom-build-including-css-and-html-files

但是,我无法在上述链接中了解如何使用Kallenboone的代码。

But I am unable to get how to use the code by Kallenboone in the above link.

推荐答案

查看以下链接,了解如何为dojo创建构建:

Take a look at the following link on how to create builds for dojo:

http://dojotoolkit.org/documentation/tutorials/ 1.7 / build /

这篇关于用于EnhancedGrid Filter插件的Dojo AMD样式模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆