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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

120126 Sep 3,2015 05:08 AM UTC Sep 11,2015 04:36 AM UTC JavaScript 3
loading
Tags: ejGrid
Jim Woods
Asked On September 3, 2015 05:08 AM UTC

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?

Code
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" }
            ];



$("#Grid").ejGrid({
                //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);

Prasanna Kumar Viswanathan [Syncfusion]
Replied On 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:
 https://www.syncfusion.com/kb/3539/error-in-filter-menu-number-date-and-boolean-columns-have-incorrect-operators
Please find the sample from the following link:
Sample Link: http://www.syncfusion.com/downloads/support/forum/120126/ze/Html_Encode_Feature-944278058
Regards,
Prasanna Kumar N.S.V


Jim Woods
Replied On September 10, 2015 03:49 AM UTC

Thank you.  That worked!

Prasanna Kumar Viswanathan [Syncfusion]
Replied On 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.

Regards,
Prasanna Kumar N.S.V

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;