0

GXT のフィルター グリッド ( http://www.sencha.com/examples-2/#filtergrid ) を使用しています。フィルターが適用されたら、ユーザーが入力したフィルターされたテキストを削除する必要があります。

ここに画像の説明を入力

ユーザーの介入なしにプログラムで「abc」テキストを削除することは可能ですか?

ありがとう!

4

1 に答える 1

0

以下のコードを試してください。私はこれをテストしていません。

new StringFilter("someValue") {
            @Override
            protected void fireUpdate() {
                super.fireUpdate();
                List<Component> items = menu.getItems();
                if (!items.isEmpty()) {
                    ((Field) items.get(0)).setValue("");
                }
// Not tested this. If the above code is not working try to get the 
textfield instance somehow from the menu and clear it 
            }

        };

ユーザーのキー入力のみで値をクリアし、プログラムによるフィルター (setValue() 経由) ではクリアしない場合、上記は機能しません。onFieldKeyUp メソッドをオーバーライドし、スケジューラを使用してクリアする必要があります。

于 2012-06-28T07:50:41.490 に答える