0

2 つの別々のタブに 2 つのリストがあり、両方ともサーバー側のデータベースに接続されています。リストのページングを設定しようとしていますが、リストの 1 つで、本来あるべきように機能しています。もう 1 つのリストについては、モデルとストアの設定はすべてリストと同じであり、適切にページが表示されますが、このリストの下部に「もっと読み込む...」というテキストは表示されません。

リスト ページング プラグインに関しては、両方のリストは基本的に互いにまったく同じです (つまり、ストア、モデル、「リスト」ビュー) が、一方ではページングが機能しません。何がこれを引き起こしている可能性があるのか​​ 誰にも分かりますか?

いくつかの詳細情報を編集する:

開発にはChromeを使用しています。ネットワークを見ると、正しく見える JSON を取得しているように見えます。動作していないものについては、8 つのレコードが返され、返されるプロパティの合計は 13 です (ページ サイズが 8 に設定されているため、これは理にかなっています)。

機能しないリストからのストア

    Ext.define("IdeaBank.store.SharedProblems", {
extend: "Ext.data.Store",
required: "IdeaBank.model.SharedProblem",
config: {
    model: "IdeaBank.model.SharedProblem",
    clearOnPageLoad: false,
    pageSize: 8,
    proxy: {
        type: 'ajax',
        api: {
            create:      "http://mywebsite.com/submitProblem.php?action=create",
            read: "http://mywebsite.com/submitProblem.php?action=read",
            update: "http://mywebsite.com/submitProblem.php?action=update",
            destroy: "http://mywebsite.com/submitProblem.php?action=delete",
        },
        reader: {
            type: 'json',
            rootProperty: "problems",
            totalProperty: "total",
        }
    },
    autoLoad: true
}
 });

機能するリストからストア

Ext.define("IdeaBank.store.SharedSolutions", {
extend: "Ext.data.Store",
required: "IdeaBank.model.SharedSolution",
config: {
    model: "IdeaBank.model.SharedSolution",
    clearOnPageLoad: false,
    proxy: {
        type: 'ajax',
        api: {
            create: "http://mywebsite.com/submitSolution.php?action=create",
            read: "http://mywebsite.com/submitSolution.php?action=read",
            update: "http://mywebsite.com/submitSolution.php?action=update",
            destroy: "http://mywebsite.com/submitSolution.php?action=delete",
        },
        reader: {
            type: 'json',
            rootProperty: "solutions",
            totalProperty: "total",
        }
    },
    pageSize: 8,
    autoLoad: true
}
});

機能しないリスト ビュー

Ext.define("IdeaBank.view.SharedProblemsList", {
extend: 'Ext.dataview.List',
alias: 'widget.sharedproblemslist',
requires: ['Ext.plugin.ListPaging'],
config: {
    autoLoad: true,
    plugins: [
        {
            xclass: 'Ext.plugin.ListPaging',
            autoPaging: true

        }
    ],
    loadingText: "Loading...",
    emptyText: [
                "</pre><div class='notes-list-empty-text'  style = 'padding: 2em;'>",
                "<p>There are no problems listed for the category you have selected.</p>",
                "</div><pre>"
                ].join(""),
    onItemDisclosure: true,
    itemTpl: [
            "</pre>",
                "<div class = 'list-item-title'><span style = 'margin-right: 5px; color: #25E014; font-size: 0.7em;'>{rating}</span> {problem}</div>",
            "<pre>"
            ].join(""),
}

});

機能するものからのリストビュー

Ext.define("IdeaBank.view.SharedSolutionsList", {
extend: 'Ext.dataview.List',
alias: 'widget.sharedsolutionslist',
requires: ['Ext.plugin.ListPaging'],
config: {
    autoLoad: true,
    plugins: [
        {
            xclass: 'Ext.plugin.ListPaging',
            autoPaging: true
        }
    ],
    loadingText: "Loading...",
    emptyText: [
                "</pre><div class='notes-list-empty-text'  style = 'padding: 2em;'>",
                "<p>There are no published solutions for the category you have selected.<p>",
                "</div><pre>"
                ].join(""),
    onItemDisclosure: true,
    itemTpl: [
            "</pre>",
                "<div class = 'list-item-title'><span style = 'margin-right: 5px; color: #25E014; font-size: 0.7em;'>{rating}</span> {title}</div>",
            "<pre>"
            ].join(""),
}

});
4

1 に答える 1

0

サーバー側のコードにページング ロジックを実装していることを確認してください。ページごとに送信する機能を提供する必要があります。「submitSolution.php」がデータを部分的に送信していない可能性があります。

于 2012-11-15T12:07:15.170 に答える