EJ2 TreeGrid: Basic TreeGrid with remote dataManager throws error on initial add as well as spinner won't hide

So with a super basic TreeGrid and a remote dataManager that returns an empty dataset to start with, when you go to add your first item via the Add button, when you click save the following error is thrown in the console and the item is never sent to the server.  As long as the dataset returns with at least 1 item, everything works as expected.

Uncaught TypeError: Cannot read property 'length' of undefined
    at e.beginAddEdit (ej2.min.js?id=68729179e2599736a9df:1)
    at e.beginEdit (ej2.min.js?id=68729179e2599736a9df:1)
    at e.notify (ej2.min.js?id=68729179e2599736a9df:1)
    at t.notify (ej2.min.js?id=68729179e2599736a9df:1)
    at e.<anonymous> (ej2.min.js?id=68729179e2599736a9df:1)
    at e.notify (ej2.min.js?id=68729179e2599736a9df:1)
    at t.e.trigger (ej2.min.js?id=68729179e2599736a9df:1)
    at t.grid.actionBegin (ej2.min.js?id=68729179e2599736a9df:1)
    at e.notify (ej2.min.js?id=68729179e2599736a9df:1)
    at t.e.trigger (ej2.min.js?id=68729179e2599736a9df:1)

Additionally, the spinner artifact remains after data is bound and needs to be removed via:

dataBound: function (args){
                $('.e-spinner-pane.e-spin-show').remove();
            },




1 Reply 1 reply marked as answer

PK Padmavathy Kamalanathan Syncfusion Team May 21, 2021 01:46 PM UTC

Hi Mark, 
 
Greeting from Syncfusion Support. 
 
Query 1: TreeGrid and a remote dataManager that returns an empty dataset to start with, when you go to add your first item via the Add button, when you click save the following error is thrown in the console 
Query 2: the spinner artifact remains after data is bound 
 
We have tried to reproduce the issue with empty records in Tree Grid. But we could not reproduce it at our end. Kindly share us the below details so that we could proceed further, 
  1. Complete Tree Grid rendering code(client and server end – both data binding and CRUD functionality handling)
  2. Kindly let us know the edit mode and newRowPosition you are using
  3. Video demo of the issue with exact scenario
  4. Also share us your product version details
  5. If possible, share us issue reproducible sample or reproduce the issue in the below sample
 
 
Please check the below help documentation, 
 
NOTE: Based on the newRowPosition, we need to handle Insert operation at server end. We have already shared code for “Below” position. Please check the below help documentation, 
 
Regards, 
Padmavathy Kamalanathan 


Marked as answer
Loader.
Up arrow icon