This is a migrated thread and some comments may be shown as answers.

How create a unique input filter?

1 Answer 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rod
Top achievements
Rank 1
rod asked on 25 Aug 2014, 07:04 PM
I'm have a my input text: 

    <input type="text" id="txtSearch" class="form-control" placeholder="Buscar" />
    <span class="input-group-btn">
        <button class="btn btn-default" type="button" onclick="Search()">
            <i class="glyphicon glyphicon-search"></i>
        </button>
    </span>

And my javascript

    function Search() {
        $.ajax({
            type: "POST",
            url: '@Url.Content("~/groups/Search")',
            data: JSON.stringify({ Search: $('#txtSearch').val() }),
            contentType: "application/json",
            dataType: "JSON",
            success: function (result) {
                $('#grid').data("kendoGrid").dataSource.data(JSON.parse(result));
            }
        });
    }

But, return error :/

Sugest?

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 27 Aug 2014, 11:12 AM
Hello,

I am not sure if I understand correctly the problem but a JavaScript error will be thrown with the used code because the response will already be parsed. Could you check if passing the result without using the JSON.parse method resolves the problem:
success: function (result) {
    $('#grid').data("kendoGrid").dataSource.data(result);
}


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
rod
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or