0

Web と SO を検索しても成功しなかった後、私はあなたの助けを求めています。

Dojox EnhancedGrid をプログラムして、ページネーション プラグインを使用したいのですが、グリッドを呼び出すと次のエラーが表示されます: -- [11:16:33.236] エラー: プラグイン ページネーションが必要です。

ページネーションを削除すると、再び正常に動作します。css ファイルも正しく読み込まれます。Dojo 1.9を使用しています

私は何も見逃していないと思いますが、見てください:

require([
    "dojo/dom-style", 
    "dijit/form/CheckBox",
    "dojo/dom",
    "dojo/on",
    "dojo/_base/array",
    "dojox/grid/DataGrid",
    "dojox/grid/EnhancedGrid",
    "dojox/grid/enhanced/plugins/IndirectSelection",
    "dojox/grid/enhanced/plugins/Pagination",
    "dojox/grid/enhanced/plugins/exporter/CSVWriter",
    "dojo/data/ItemFileReadStore",
    "dojo/data/ObjectStore",
    "dojo/store/Memory",
    "dojo/dom-construct",
    "dijit/registry",
    "dojo/json",
    "dojo/dom-style",
    "dojo/domReady!"], 
    function(
    domStyle,
    checkbox,
    dom,
    on,
    array,
    DataGrid,
    EnhancedGrid,
    IndirectSelection,
    Pagination,
    CSVWriter,
    ItemFileReadStore,
    ObjectStore,
    Memory,
    domConstruct,
    registry,
    domStyle,
    JSON){
    var ErgebnisPane;
    var selectedMessPunkte = [];
    var MPStore;

    if (idResults.length) {
        dojo.style("DefaultContentPane",'height','180px');
        dojo.style("DefaultContentPane",'width','200px');

        dojo.style(dojo.byId("DefaultTitlePane"), "display", "block");

            array.forEach(idResults, function(list){
                selectedMessPunkte.push({
                    ident: list.feature.attributes.OBJECTID,
                    numbez: list.feature.attributes.NUMBEZ,
                    pnr: list.feature.attributes.PNR,
                    r: list.feature.attributes.R,
                    h: list.feature.attributes.H,
                    hoehe: list.feature.attributes.HÖHE,
                    vma: list.feature.attributes.VMA,
                    geo: list
                });
        }); 

        var dataItems = {
                 identifier: 'ident',
                 items:selectedMessPunkte
                };
        //Datastore füllen
        var store = new Memory({data:dataItems});
        MPStore = new ObjectStore({objectStore: store});

        //Grid Layout erstellen
        var layout = [
            {name:"ID", field: "ident"},
            {name:"Numerierungsbezirk", field: "numbez"},
            {name:"Punktnummer", field: "pnr"},
            {name:"Rechtswert", field: "r"},
            {name:"Hochwert", field: "h"},
            {name:"Hoehe", field: "hoehe"},
            {name:"Vermarkungsart", field: "vma"}
            ];

           MPSGrid = new EnhancedGrid({
                    id: 'MPSGrid',
                    store: MPStore,
                    query: { ident: "*" },
                    structure: layout,
                    rowSelector: '20px',
                    keepSelection: false,
                    plugins: {
                        indirectSelection: {
                            headerSelector:false,
                            width:"40px",
                            styles:"text-align: center;"
                            },
                        Pagination: {
                            description: true,
                            pageStepper: true,
                            sizeSwitch: true,
                            pageSizes: ["25","50","100","All"],
                            maxPageStep: 4,
                            position: "bottom"                              
                            }
                          }                         
                    });
            MPSGrid.placeAt("DefaultContentPane");
            MPSGrid.startup();  
    }
});
}

前もって感謝します!

よろしく、ミリアム

4

2 に答える 2

1

にプラグインを含めるための構文では、プラグインのクラスやインスタンスではなく、プラグインの宣言名EnhancedGridを使用します ( http://dojotoolkit.org/reference-guide/1.9/dojox/grid/EnhancedGrid/plugins/Pagination. html#plugin-declaration )。

必要なときにプラグインを変数にマップする必要さえありません。

require(["dojox/grid/enhanced/plugins/Pagination"],function(){...});

あなたの例では、変数(大文字の 'I' とタイプミス) ではなく、IndirectSelectionその名前 ( indirectSelection、小文字の 'i')を使用しているため、 は正しくロードされます。IndirectSelction

于 2013-11-06T13:55:12.000 に答える