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

Row is going lost if editmode is poup and cancel clicked

10 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ralf
Top achievements
Rank 1
Ralf asked on 02 Feb 2015, 12:19 PM
Hello,

I'm using an external button to start row editing. When a row is selected and I click the button, the popup editor will be displayed. Clicking "Cancel" the popup editor closes but the selected row will be removed. Whay?

I have created an example: http://dojo.telerik.com/@ralf.d-velop/orIme

What's wrong?

Regards,
Ralf

10 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 04 Feb 2015, 07:56 AM

Hello Ralf,

The problem is caused by missing transport - read/update/create definition. Please check the following documentation article that will show you a basic scenarios how to implement them:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-transport

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ralf
Top achievements
Rank 1
answered on 04 Feb 2015, 09:05 AM
Hello Kiril,

so I have to define transport configuration when using local data also? And if so, how to define?

Regards,
Ralf
0
Kiril Nikolov
Telerik team
answered on 04 Feb 2015, 12:22 PM

Hello Ralf,

Please check the following How To article as it might be helpful:

http://docs.telerik.com/kendo-ui/web/grid/how-to/grid-localstorage-crud

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ralf
Top achievements
Rank 1
answered on 04 Feb 2015, 12:52 PM
Hello Kiril,

thank you for information. I will change my code.

Maybe it's possible to implement some function to handle a kendo.observableHierarchy as data for the datasource and no transport configuration has to defined when using local data. And if it's possible to define the model/schema using MVVM, we have to write less code. The most prefered way is to bind only an observable array as datasource, defining columns and model/schema in MVVM way and the controls create their datasource self.  Then we have to bind only the viewmodel and thats all :-)

Best regards,
Ralf
0
Ralf
Top achievements
Rank 1
answered on 06 Feb 2015, 07:35 AM
Hello Kiril,

I have changed my code and added the transport configuration. But when clicking "Cancel" in the popup editor the selected row will be still removed. Here is my code: Cancel editing with transport is configured

I have tested also with kendo.observableHierarchy with same result: Cancel editing without tramsport

What I'm doing wrong?

Best regards,
Ralf
0
Kiril Nikolov
Telerik team
answered on 06 Feb 2015, 08:48 AM

Hello Ralf,

I have tested your example, but was not able to reproduce the issue. Please check this screencast and let me know what I missed:

http://screencast.com/t/WSsmKEvy

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ralf
Top achievements
Rank 1
answered on 09 Feb 2015, 06:41 AM
Hello Kiril,

try click "Edit" and in the poup editor click "Cancel". Then the row will be removed. That's the problem.

Adding works, Changing data works, Cancel doesn't work. Why?
When using kendo.observableHierarchy without define transport config add new data works, edit and remove works. Cancel doesn't work. Why? 

Best regards,
Ralf  
0
Ralf
Top achievements
Rank 1
answered on 09 Feb 2015, 09:52 AM
Hello Kiril,
I've found the problem. I've added the detail data as an field to the master data.

ar masterData = [
        {RowID: kendo.guid(), Title: "Master 1", Options: createOptionsData(1) },
        {RowID: kendo.guid(), Title: "Master 2", Options: createOptionsData(2) },
        {RowID: kendo.guid(), Title: "Master 3", Options: createOptionsData(3) }
      ];
     
    function createOptionsData(id) {
      var data = [
        {RowID: kendo.guid(), Title: "Master " + id + " Option 1" },
        {RowID: kendo.guid(), Title: "Master " + id + " Option 2" },
        {RowID: kendo.guid(), Title: "Master " + id + " Option 3" }
      ];
      return data;
    }

When edit an option data entry and click "Cancel" the observable functions starting, and both grids will be actualized.
When removing the field from master data and assign the details of selected master entry as separate array all is working fine.

So maybe it's possible to add new data type like "Array", and handle changes to this array in a separate way, so the observable functions are not infect Add, Update, Cancel an Remove functions? It would by much easier to work with depended data.

Best regards,
Ralf


0
Kiril Nikolov
Telerik team
answered on 09 Feb 2015, 02:43 PM

Hello Ralf,

You can always submit this as a feature request on UserVoice, so it will be considered for a future implementation. As for the problem you are right that with your approach you are passing the array, but not the configuration and I missed that - apologies.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ralf
Top achievements
Rank 1
answered on 10 Feb 2015, 06:23 AM
Hello Kiril,

thank you for information. I will submit a feature request.

Best regards,
Ralf
Tags
Grid
Asked by
Ralf
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Ralf
Top achievements
Rank 1
Share this question
or