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

Grid Inline Adding not working

3 Answers 638 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Grant asked on 17 Jan 2017, 10:42 AM

Hi, 

I dont know much about inline editing so Im a little lost with this error, but whenever I try to add a new row, an error is thrown in the console. However if I edit, no error is thrown.

Dojo Example: http://dojo.telerik.com/OPEXO

There isnt much functionality at this stage as I just started when this came up.

Any advice would be appreciated.

Thanks,
Grant

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 18 Jan 2017, 12:31 PM
Hello Grant,

Thank you for the runnable example.

The described error is caused by the fact that an attempt to reference a nested property on a complex object is made (when a new item is added, its "escalationMethod" is still not defined, and escalationMethod.description leads to the JavaScript TypeError).

You can use the schema.model option to provide a default value for all such complex properties, e.g.:

http://dojo.telerik.com/OPEXO/2

On a side note, please mind that the dataSource.transport should be properly configured for CRUD operations in editing scenarios. You can find detailed explanation and examples in the following section of our documentation:

http://docs.telerik.com/kendo-ui/framework/datasource/crud

I hope this helps.

Regards,
Dimiter Topalov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
answered on 19 Jan 2017, 08:02 AM

HI Dimiter, 

Thank you SO much for you help, my inline grid functionality has grown considerably since this post due to you advice. This is the first inline Grid I've done, so it allowed me to explore the dataSource.schema attribute in more depth, which has been helpful. In the past I've been using custom windows to capture data, but now that my understanding has grown, I may be able to use the built in popup in the future (very exciting!).

This work has lead me to a couple questions I was hoping you could answer, I've updated the demo for this, http://dojo.telerik.com/OPEXO/4

1) If you look at line 44, inside the editor Im initializing a kendoNumericTextBox, how would I dynamially set the max attribute here to the next number in the 'Escalation Level' sequence, in this case 4?
2) I also need to dynamically set the default values for both 'escalationLevel' and 'escaltionAfterDuration', details on lines 101 and 120 respectively. 

Once again, thanks for the help, much appreciated,
Grant

0
Accepted
Dimiter Topalov
Telerik team
answered on 20 Jan 2017, 02:31 PM
Hi Grant,

All desired functionalities can be achieved via applying some custom logic, based on the Grid's dataSource data()/view() and total(), e.g.:

http://dojo.telerik.com/OPEXO/5

On a side note, for questions that are not related to the thread's original topic and scenario, please open a new thread. This will facilitate a tidier support history of your account and better support service.

Regards,
Dimiter Topalov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 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
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Dimiter Topalov
Telerik team
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Share this question
or