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

Cannot read property 'replace' of undefined

Thread ID:





130352 May 8,2017 03:14 PM UTC May 10,2017 03:54 AM UTC JavaScript 3
Tags: ejGrid
Matt Abercrombie
Asked On May 8, 2017 03:14 PM UTC

I am having trouble determining the cause of the following error:

Uncaught TypeError: Cannot read property 'replace' of undefined
    at Object.addDialogEditingTemplate (syncfusion?v=FHfwf1VEXuKT1aGrDV-JFsoW9t-9CzK0CnArdjh0qIk1:51)
    at Object._initiateTemplateRendering (syncfusion?v=FHfwf1VEXuKT1aGrDV-JFsoW9t-9CzK0CnArdjh0qIk1:51)
    at Object._processEditing (syncfusion?v=FHfwf1VEXuKT1aGrDV-JFsoW9t-9CzK0CnArdjh0qIk1:51)
    at Object._initGridRender (syncfusion?v=FHfwf1VEXuKT1aGrDV-JFsoW9t-9CzK0CnArdjh0qIk1:51)
    at Object._initDataProcess (syncfusion?v=FHfwf1VEXuKT1aGrDV-JFsoW9t-9CzK0CnArdjh0qIk1:51)
    at Object.<anonymous> (syncfusion?v=FHfwf1VEXuKT1aGrDV-JFsoW9t-9CzK0CnArdjh0qIk1:51)
    at t.DataManager.<anonymous> (syncfusion?v=FHfwf1VEXuKT1aGrDV-JFsoW9t-9CzK0CnArdjh0qIk1:51)
    at j (DXR.axd?r=1_181,1_179,1_180,1_178,1_243,1_164,1_138,1_141,1_135,1_219,1_232,1_226,1_229,1_137,17_41…:2)
    at Object.fireWith [as resolveWith] (DXR.axd?r=1_181,1_179,1_180,1_178,1_243,1_164,1_138,1_141,1_135,1_219,1_232,1_226,1_229,1_137,17_41…:2)
    at t.DataManager.<anonymous>

  • When my grid is initially loaded without any results and I have the allowAdding or allowEditing set to "true", I receive the error above. 
  • If I do not have either of those set to "true", I do not get the error. 
  • If my initial result set is not empty, I do not receive the error even if filters applied on subsequent requests result in no data.

I've attached the complete ejGrid initialization for reference.

Attachment: ejgridsnippet_e417ed16.zip

Mani Sankar Durai [Syncfusion]
Replied On May 9, 2017 12:42 PM UTC

HI Matt, 
Thanks for contacting Syncfusion support. 
   We have analyzed your query and we are able to reproduce the reported issue. We confirmed that the issue with “script error throws when data is empty with command column” is a defect, and we have logged a defect report. The fix for this issue will included in our Volume 2 SP1, 2017 release expected to be out by the month of May, 2017. 
Until then we suggest you to follow the below work around which helps to solve the issue. 
If you need the headerText for the command column please assign headerText for it else if no need we suggest you to pass as empty string for the command column headerText. 
Refer the code example. 
                dataSource: [], 
                columns: [ 
                        headerText: "", 
                        width: 30, 
                        commands: [ 
                            { type: ej.Grid.UnboundType.Edit, buttonOptions: { contentType: "imageonly", prefixIcon: "e-icon e-edit" } } 
              editSettings: { 
                    allowAdding: true, 
                    allowEditing: true, 
                    editMode: ej.Grid.EditMode.InlineForm 
                toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add] } 

We have also prepared a sample that can be downloaded from the below link. 
Refer the documentation link. 
Please let us know if you need further assistance. 
Manisankar Durai 

Matt Abercrombie
Replied On May 9, 2017 03:50 PM UTC

Workaround is perfect! Thank you very much for the prompt response and solution.

Mani Sankar Durai [Syncfusion]
Replied On May 10, 2017 03:54 AM UTC

Hi Matt, 

We are happy to hear that your problem has been solved. 

Please let us know if you need further assistance. 

Manisankar Durai. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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