具有输入类型=“搜索"的Lightswitch HTML.不工作 [英] Lightswitch HTML with input type="search" not working

查看:91
本文介绍了具有输入类型=“搜索"的Lightswitch HTML.不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查询设置,可以接受搜索参数,还有一些其他代码段可以在输入框中包含2个以上字符时自动搜索,并在输入框为空时清除搜索.搜索框通过呈现 javascript.

I have a query set up that accepts a search parameter, and a few other bits of code that automatically searches the when there are more than 2 characters in the inputbox, and clears the search if the inputbox is empty. The searchbox is being rendered via javascript.

一切都一样,将输入设置为文本":

Everything works like this, with the input set to "text":

myapp.ViewCustomers.SearchTerm_render = function (element, contentItem) {
    // Write code here.
    $(element).append('<input type="text" />');
    onInputAsYouType(element, 2, function (text) {
        contentItem.screen.SearchTerm = text;
    });
    function onInputAsYouType(element, numberOfRequiredChars, done) {
        var inputbox = $("input", $(element));
        inputbox.on("input", function (e) {
            var text = $(this).val();
            if (text.length >= numberOfRequiredChars) {
                done(text);
            } else {
                if (text.length == 0) {
                    done(text);
                };
            };
        });
    };
};

从输入类型更改为搜索"的那一刻起,我失去了所有搜索功能.我认为搜索"与搜索"之间的唯一区别是和文本"是放大镜图标,可以清除输入框.

The moment I change the input type to "search" I lose all search functionality. I thought the only difference between "search" and "text" was the magnifying glass icon and ability to clear the inputbox. 

lightswitch是否支持输入搜索类型?如果是这样,您将如何使用它们?我似乎无法使其正常工作.

Does lightswitch support input types of search? If so, how do you go about using them? I can't seem to get it to work.

推荐答案

lightswitch是否支持输入搜索类型?如果是这样,您将如何使用它们?我似乎无法使其正常工作.

Does lightswitch support input types of search? If so, how do you go about using them? I can't seem to get it to work.

@ thatITguyfromGA 解决了吗?我有类似的问题.

@ thatITguyfromGA  Have you solved it?  I have similar problem.


这篇关于具有输入类型=“搜索"的Lightswitch HTML.不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆