This is a migrated thread and some comments may be shown as answers.

"Object expected" error when expanding updated grid row

1 Answer 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Clarissa
Top achievements
Rank 1
Clarissa asked on 15 May 2018, 10:19 AM

I have this code:

http://dojo.telerik.com/OPaGEXik

It works fine until addHistory() function is not fired. After that, the last added row in the gird is throwing "Object expected" when expanded.

In the dojo and the button added the error is a bit different but I think the root of the problem is the same.

What is the issue here?

1 Answer, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 16 May 2018, 01:03 PM
Hi Clarissa,

I have examined the code and noticed that the historyGrid() method initiates a new Grid widget. When the button is clicked the method is called again and a new widget is created. However the old instance is not destroyed. This is why an error is shown. 

With that said, if you would like to add items to the Grid dataSource I would suggest using the add() method. The dojo below outlines the approach:

 

Give the approach a try and let me know how it works for you.

Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Clarissa
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or