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

Complex form with master-detail grid pair, seperate create and edit components?

1 Answer 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
BitShift
Top achievements
Rank 1
Veteran
BitShift asked on 11 Jul 2018, 01:46 PM

Would like some Kendo-specific suggestions or tips to best use the components, mainly in regards to whether or not seperate "create" and "edit" components should be created.  The UI im putting together is fairly complex and ill either need to manage the complexity of having almost identical create and edit components, or managing whether or not the user is editing or creating a new object.  So, either in general or given the scenario below, would you look at creating separate "create" and "edit" components?

Generally I have been using separate create and edit components when using angular with basic html components.  However, I think I should be able to manage a particular object type with just a single component.  Eg the Angular.io example managing heros.  The example below allows listing and editing a "hero", but not creating a new hero. 
example

The UI im about to build involves two grids in a master/detail relation, along with other elements related to the parent object. So the user would come to this screen and start a new DeliveryBucket by entering some basic info about the DeliveryBucket, then adding items to Grid A and for each row in Grid A, they would need to add items to Grid B.  Once they have enough to start they could "save" the DeliveryBucket which would persist the data model back to the database via an angular service and api.

The data model looks something like this. 

DeliveryBucket
    |___Path
        |__<Destination>
                |__Order
                    |__<OrderItem>

Where:  
- DeliveryBucket will contain a single path
- Path contains one or more Destinations
- Destination contain a single order
- Order contains one or more OrderItem

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Svet
Telerik team
answered on 13 Jul 2018, 07:43 AM
Hi BitShift,

In general, Kendo Ui for Angular provides native components built from the ground up, that can be utilized in an Angular application and fully benefit from the pros of the framework. In case we decide to use separate components for creating and editing we will end up with a good separation of concerns, where each component will be doing exactly what it is supposed to do. But this will also introduce some repeating code as we will need to create similar if not the same markup for the two components. This can be avoided by using a single component for the create and edit functionalities. We implemented a similar approach in the following article from our documentation, where we can create, edit, display and remove items:
https://www.telerik.com/kendo-angular-ui/components/grid/editing/editing-reactive-forms/

I hope this provides some more information on the topic. However, it stays in the hands of the developer to overtake the most suitable design for the specifics of the project. 

Regards,
Svetlin
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
General Discussions
Asked by
BitShift
Top achievements
Rank 1
Veteran
Answers by
Svet
Telerik team
Share this question
or