0

少し調査を行ったが、これについては何も見つかりませんでした...基本的な連絡先テーブル用のLightSwitchアプリケーションを作成しました..ブラウズ画面には名前、番号などが含まれています...検索パラメータを使用する場合、それは可能ですか、それともキーストロークごとにこの検索テキストボックスを自動更新しますか?

たとえば、「A」と入力すると、姓に基づいて、エンター キーを押さずに、A で始まるすべての姓が読み込まれます。

これは内部設定で行うことができますか? または、JavaScript または C# を使用する必要がありますか > 助けてくれてありがとう

4

2 に答える 2

1

http://blog.pragmaswitch.com/?p=1670からこれを入手しましたが、美しく動作します。すべての検索画面で使用しています。

myapp.BrowseScreen.SearchText_postRender = function (element, contentItem) {
    // This block is from somewhere else, sets the focus to the search box
    $searchBox = $("input", $(element));
    setTimeout(function () {
        $searchBox.focus();
    }, 1);

    // The blog post linked above set the required characters to 3, but I liked the instant filtering of 1
    onInputAsYouType(element, 1, function (text) {
        contentItem.screen.SearchText = text; //SearchText here is the data item in the screen designer linked to the query parameter
    });

    function onInputAsYouType(element, numberOfRequiredChars, done) {
        var inputbox = $("input", $(element));
        inputbox.on("input", function (e) {
            var text = $(this).val();
            if (text.length >= numberOfRequiredChars)
                done(text);
        });
    };
};

スクリーンショットについてはブログ投稿にアクセスできますが、それは非常に簡単です。ブラウズ/検索画面を作成し、検索テキストをテキスト ボックスにして、このコードをポスト レンダリングにプラグインします。

于 2014-08-14T17:19:07.993 に答える
0

コードはわかりませんが、textBox の「text_changed」イベントにコードを直接挿入してみてください。

private void textBox_TextChanged(object sender, EventArgs e)
    {
        //your code here for instance, or call a method that contain your code
    }
于 2014-06-06T08:57:48.520 に答える