Note that there are some explanatory texts on larger screens.

plurals
  1. POfilter kendo ui grid with filed type object
    text
    copied!<p>I have this grid </p> <pre><code>$("#address-grid").kendoGrid({ dataSource: { transport: { read: { url: "operations/get_sales_reps_addresses.php?salesRepsId=" + salesRepsId, type: "GET" }, update: { url: "operations/edit_address.php?salesRepsId=" + salesRepsId, type: "POST", complete: function (e) { $("#address-grid").data("kendoGrid").dataSource.read(); } }, destroy: { url: "operations/delete_address.php", type: "POST", complete: function (e) { $("address-grid").data("kendoGrid").dataSource.read(); } }, create: { url: "operations/add_address.php?salesRepsId=" + salesRepsId, type: "POST", complete: function (e) { $("#address-grid").data("kendoGrid").dataSource.read(); } }, }, schema: { data: "data", total: "data.length", //total amount of records model: { id: "SalesRepId", fields: { AddressType: { defaultValue: { AddressTypeid: 1, AddressTypeName: "Work" } }, Country: { defaultValue: { CountryId: 38, CountryName: "Canada" } }, State: { defaultValue: { StateId: 4223, StateName: "British Colombia" } }, City: { defaultValue: { CityId: 59450, CityName: "Vancouver" } }, PostalCode: { type: "string" }, AddressText: { type: "string" }, IsMainAddress: { type: "boolean" }, AddressId: { type: "integer" } } } }, pageSize: 3, }, ignoreCase: true, height: 250, filterable: true, sortable: true, pageable: true, reorderable: false, groupable: false, batch: true, navigatable: true, toolbar: ["create", "save", "cancel"], editable: true, columns: [{ field: "AddressType", title: "Type", editor: AddressTypeDropDownEditor, template: "#=AddressType.AddressTypeName#", }, { field: "Country", title: "Country", editor: CountryDropDownEditor, template: "#=Country.CountryName#", }, { field: "State", title: "State", editor: StateDropDownEditor, template: "#=State.StateName#", }, { field: "City", title: "City", editor: CityTypeDropDownEditor, template: "#=City.CityName#", }, { field: "PostalCode", title: "Postal Code", }, { field: "AddressText", title: "Address", }, { field: "IsMainAddress", title: "Main?", width: 65, template: function (e) { if (e.IsMainAddress == true) { return '&lt;img align="center" src ="images/check-icon.png" /&gt;'; } else { return ''; } } // hidden: true }, { command: "destroy", title: "&amp;nbsp;", width: 90 }, ] }); </code></pre> <p>The problem is when I try to filter by Country or State or City I got an error</p> <blockquote> <p>TypeError: "".toLowerCase is not a function</p> </blockquote> <p>I tried to change the type of Country to string, I use comobox, so the values were undefined. I also tried to change the type to Object, the values displayed correctly but I couldn't filter. I got the same error( toLowerCase)</p> <p>How can I fix this ?? </p> <p>My grid is very similar <a href="http://demos.kendoui.com/web/grid/editing-custom.html" rel="nofollow">this example</a> </p> <p>and here is the <a href="http://jsfiddle.net/Sbb5Z/460/" rel="nofollow">jsFiddle</a> . I've just added the filter. and I still get previous error</p> <p>I want to filter on the Category, any help ??</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload