Currently using version 2014.3.1411.
I am trying to always filter on the "contains" operator for string columns in my grid.
The problem is that when I start typing in any of the the filters, a request is sent to the
DataSource Read with the following data:
sort:page:1group:filter:Name~startswith~'t'
Then after a delay a second call is sent:
sort:page:1pageSize:5group:filter:Name~contains~'t'
The second call is correct. It has the correct pageSize and filter.
In the grid I have removed all filters except Contains and assigned an Operator("contains") to each filtered cell.
If I inspect the Filter i see this:
This is the grid:
Why is the first call happening and why does the input data-filter contain the wrong operator?
thanks
I am trying to always filter on the "contains" operator for string columns in my grid.
The problem is that when I start typing in any of the the filters, a request is sent to the
DataSource Read with the following data:
sort:page:1group:filter:Name~startswith~'t'
Then after a delay a second call is sent:
sort:page:1pageSize:5group:filter:Name~contains~'t'
The second call is correct. It has the correct pageSize and filter.
In the grid I have removed all filters except Contains and assigned an Operator("contains") to each filtered cell.
If I inspect the Filter i see this:
<input data-bind="value: value" data-role="autocomplete" data-text-field="Name" data-filter="startswith" data-delay="100" data-min-length="1" data-value-primitive="true" type="text" class="k-input" autocomplete="off" role="textbox" aria-haspopup="true" aria-disabled="false" aria-readonly="false" aria-autocomplete="list" aria-owns="" style="width: 100%;" aria-busy="false"><br>This is the grid:
@helper RenderProductsSearch(){ @(Html.Kendo().Grid<ViewableSelectableProduct>() .Name("grid-products-search-#=ID#") .AutoBind(true) .Pageable(pager => pager .Input(true) .Numeric(true) .Info(true) .PreviousNext(true) .Refresh(true) .PageSizes(true) ) .Scrollable() .Sortable() .Navigatable() .Filterable(ftb => ftb.Mode(GridFilterMode.Row)) .HtmlAttributes(new { style = "height: 100%; border: 0;" }) .Columns(columns => { columns.Bound(e => e.Name).Width(300).Title("name").Filterable(f => f.Cell(cell => cell.Operator("contains").ShowOperators(false).Delay(100))); columns.Bound(e => e.Sku).Width(200).Title("sku").Filterable(f => f.Cell(cell => cell.Operator("contains").ShowOperators(false).Delay(100))); columns.Bound(e => e.ShortDescription).Title("description").Filterable(f => f.Cell(cell => cell.Operator("contains").ShowOperators(false).Delay(100))); columns.Command(command => command.Custom("Select").Click("selectProduct")) .Title("commands") .Width(Constants.Columns.Default.Widths.ColumnCommands); }) .Filterable(filterable => filterable .Extra(false) .Operators(ops => ops .ForString(str => str.Clear() .Contains("Contains") ))) .DataSource(dataSource => dataSource .Ajax() .Model(model => { model.Id(p => p.Id); model.Field(x => x.Id).Editable(false); model.Field(x => x.Name).Editable(false); model.Field(x => x.Sku).Editable(false); model.Field(x => x.ShortDescription).Editable(false); }) .PageSize(5) .Events(events => { events.Error("standard_grid_error_handler"); }) //.Batch(true) .ServerOperation(true) .Read(read => read.Action("ReadSelectable", "Product", new { blockId = "#=ID#" })) ) .ToClientTemplate() )}Why is the first call happening and why does the input data-filter contain the wrong operator?
thanks