2011-12-14 8 views
0
fbar :[{ 
        xtype  : 'datefield', 
        id   : 'date_s', 
        allowBlank : true, 
        emptyText : 'Choose date', 
        name  : 'deadline', 
        width  : 120, 
        editable : false, 
       },{ 
        xtype  : 'button', 
        text  : 'Go!', 
        handler  : function() { 
        /*f.load({ 
         params : { 
          start : 0, 
          limit : 2, 
          t : '' 
         } 
        });*/ 

        var clear = f.clearFilter(); 
        var searchValueDate1 = Ext.getCmp("date_s").getValue(); 
        var date1 = searchValueDate1.format('Y-m-d); // 00:00:00'); 

        //alert(date1); 

        //clear; 
        f.load().filter("question[deadline]", date1); 

        } 
       }] 

私はボタンをクリックしたときに、私はその後、任意の日付を選択してすることができますコンボボックスを作成 - >それだけでその日の9deadline日付で行のみを表示) 質問:私は、私はすべての権利を書いたと思いますが、しかし、動作しません!主な問題は何ですか?ExtJSの3(グリッド・フィルター)

答えて

0

どういう意味ですか?エラーがありますか?

ExtJs 3では、フィルターはウィジェットで、日付を選択するためのビジュアルフィーチャーを持つことができます。次に、フィルター処理が完了する前にデータを変更する必要がある場合にトラップするイベント(ロード)を開始します

0

(ASP/PHPの)コントローラにより良い

何かが私たちに単に過去の完全なテストコードを与えることです私たちの環境にハンドラが渡されたボタンやイベントオブジェクトを取得します。したがって、ハンドラーは次のようになります。

handler  : function (b,e) { 

var theGrid = Ext.getCmp('gridId'); //You need to get the grid to filter 
var theStore = theGrid.store; //Get the grid store you need it to filter 

var searchValueDate1 = Ext.getCmp("date_s").getValue(); 
var date1 = searchValueDate1.format('Y-m-d); // 00:00:00'); 


//Filter by filters each record if true it keeps it if false it filters it out 
theGrid.filterBy(function(rec){ 

if(rec.get('dateField') == date1){ 
    return true 
}else{ 
return false; 
} 
}); 

} 

これは基本的な考えで、このコピーと貼り付けはうまくいきません。