GXT のフィルター グリッド ( http://www.sencha.com/examples-2/#filtergrid ) を使用しています。フィルターが適用されたら、ユーザーが入力したフィルターされたテキストを削除する必要があります。
ユーザーの介入なしにプログラムで「abc」テキストを削除することは可能ですか?
ありがとう!
GXT のフィルター グリッド ( http://www.sencha.com/examples-2/#filtergrid ) を使用しています。フィルターが適用されたら、ユーザーが入力したフィルターされたテキストを削除する必要があります。
ユーザーの介入なしにプログラムで「abc」テキストを削除することは可能ですか?
ありがとう!
以下のコードを試してください。私はこれをテストしていません。
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 メソッドをオーバーライドし、スケジューラを使用してクリアする必要があります。