Row is going lost if editmode is poup and cancel clicked

11 posts, 0 answers
  1. Ralf
    Ralf avatar
    77 posts
    Member since:
    Jun 2012

    Posted 02 Feb 2015 Link to this post

    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
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 04 Feb 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Ralf
    Ralf avatar
    77 posts
    Member since:
    Jun 2012

    Posted 04 Feb 2015 in reply to Kiril Nikolov Link to this post

    Hello Kiril,

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

    Regards,
    Ralf
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 04 Feb 2015 Link to this post

    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!
     
  6. Ralf
    Ralf avatar
    77 posts
    Member since:
    Jun 2012

    Posted 04 Feb 2015 in reply to Kiril Nikolov Link to this post

    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
  7. Ralf
    Ralf avatar
    77 posts
    Member since:
    Jun 2012

    Posted 06 Feb 2015 in reply to Kiril Nikolov Link to this post

    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
  8. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 06 Feb 2015 Link to this post

    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!
     
  9. Ralf
    Ralf avatar
    77 posts
    Member since:
    Jun 2012

    Posted 09 Feb 2015 in reply to Kiril Nikolov Link to this post

    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  
  10. Ralf
    Ralf avatar
    77 posts
    Member since:
    Jun 2012

    Posted 09 Feb 2015 in reply to Ralf Link to this post

    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


  11. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 09 Feb 2015 Link to this post

    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!
     
  12. Ralf
    Ralf avatar
    77 posts
    Member since:
    Jun 2012

    Posted 10 Feb 2015 in reply to Kiril Nikolov Link to this post

    Hello Kiril,

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

    Best regards,
    Ralf
Back to Top
Kendo UI is VS 2017 Ready