We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Excel and menu filtertypes do not work when grid is initialized without data

Using the example from the Grid - Getting Started page (http://docs.syncfusion.com/js/grid/getting-started), if I start out with an empty grid and then refresh the data the excel and menu filtertypes do not work.  After I assign a datasource (from another function that I call), I get the following error message: 

'Uncaught TypeError: n.render[((this.id + this._$colType) + "_listBox_Template")] is not a function'

Is there a work around for this behavior?

window.gridData = [
        { firstName: "John", lastName: "Beckett", email: "john@syncfusion.com" },
        { firstName: "Ben", lastName: "Beckett", email: "ben@syncfusion.com" },
        { firstName: "Andrew", lastName: "Beckett", email: "andrew@syncfusion.com" }

                //dataSource: window.gridData,
                allowFiltering: true,
                filterSettings: { filterType: "excel" },
                allowPaging: true,
                allowSorting: true,
                pageSettings: { pageSize: 5 },
                columns: [
                   { field: "firstName",headerText:"First Name" },
                   { field: "lastName", headerText: "Last Name" },
                   { field: "email", headerText: "Email" }

$("#Grid").ejGrid("dataSource", window.gridData);

3 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team September 4, 2015 07:24 AM UTC

Hi Jim,
Thanks for Contacting Syncfusion support.
When we bind an empty datasource, Grid cannot find the actual data type of a column. So, the mentioned issue occurred while filtering the column.
For this case, you have to set datatype for the column using type property.
We have a Knowledge Base for type property that you can refer from the following link:
Please find the sample from the following link:
Sample Link: http://www.syncfusion.com/downloads/support/forum/120126/ze/Html_Encode_Feature-944278058
Prasanna Kumar N.S.V

JW Jim Woods September 10, 2015 03:49 AM UTC

Thank you.  That worked!

PK Prasanna Kumar Viswanathan Syncfusion Team September 11, 2015 04:36 AM UTC

Hi Jim,

We are happy that the provided details helped you.

Please let us know if you need any further assistance.

Prasanna Kumar N.S.V

Live Chat Icon For mobile
Up arrow icon