AutoFilter False

5 posts, 1 answers
  1. Barry
    Barry avatar
    7 posts
    Member since:
    Feb 2013

    Posted 19 Apr 2013 Link to this post

    Hello, I have the autoFilter set to false, but when I hit the enter key the search is not executed.

    _searchDS = new kendo.data.DataSource({
            serverFiltering: true,
            transport: {
                read: function (options) {
                    var filter = options.filter ? options.filter.filters[0].value : '';
                    $.ajax({
                        url: _serviceConst + '/Search?q=' + filter,
                        type: 'GET',
                        success: function (result) {
                            console.log('result came back: ' + result.Object.length);
                            options.success(result);
                        },
                        error: function (xhr, sts, msg) {
     
                        }
                    });
                }
            },
            schema: { data: "Object", errors: "Error" }
        });
        if (_searchMV == null) {
            _searchMV = $("#searchresults").kendoMobileListView({
                dataSource: _searchDS,
                template: $("#searchresults-template").text(),
                filterable: true,
                filterable: { autoFilter: false },
                click: function (e) {
                }
            }).data("kendoMobileListView");
        } else {
            _searchMV.setDataSource(_searchDS);
        }
    I have also tried the read statement as:
    read: {
                    url: _serviceConst + '/Search',
                    dataType: 'json'
                },
                parameterMap: function (options) {
                    var filter = options.filter ? options.filter.filters[0].value : '';
                    var parameters = {
                        q: filter
                    }
                    return parameters;
                }
    Both do not execute the search on Enter key.
    Thanks.
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 23 Apr 2013 Link to this post

    Hello Barry,

    I am afraid that the provided information is not sufficient enough in order to determine where the problem comes from. I tested the autoFilter functionality in this sample page, but did not manage to reproduce the problem. Could you please let me know what I am missing?

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Barry
    Barry avatar
    7 posts
    Member since:
    Feb 2013

    Posted 24 Apr 2013 Link to this post

    It worked with the second code block using the "parameterMap", but not with the first ajax code block.

    1. When I attempt to get access to the input element via jQuery it is not found.
    $('input[type=search]').each(function() {
               console.log('Found Search Input');
               $(this).val('Test Value');
        });
    2. When I enter a search value in the text box and press the "Search" button on the keyboard in the iPhone simulator, the search executes, but does not hide the keyboard because the focus is still on the search textbox.  How do I blur that control element?  I wanted to use the code block shown above, but it was not working.

    Any suggestions?
    Thank you.
  5. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 26 Apr 2013 Link to this post

    Hello Barry,

    I am not sure what exactly you're trying to achieve, but here is how you can find the search input and hide the keyboard on `Search` button press.
    http://jsbin.com/iyufox/4#/

    Regards,
    Nikolay Rusev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Answer
    Barry
    Barry avatar
    7 posts
    Member since:
    Feb 2013

    Posted 02 May 2013 Link to this post

    Thank you for your response, unfortunately your example works great on a web browser, but does not work in the iPhone simulator within xcode. I have found the solution for anyone that is interested in hiding the keyboard after they press the "Search" button.

    $(document).on("submit", "form", function(event){
               var searchInput = $("input[type=search]");
               searchInput.blur();
        });
Back to Top
Kendo UI is VS 2017 Ready