ListView issue with detail view

6 posts, 1 answers
  1. XiMnet Malaysia
    XiMnet Malaysia avatar
    46 posts
    Member since:
    Jan 2006

    Posted 02 Dec 2014 Link to this post

    Hi,

    In this URL, I have a Listview with its detail view.
    http://telerik.ximnet.com.my/kendo_test/#views/sample_listview.html

    When I click an item, it can show the message in the detail view.
    However, when I click Cancel and click on another item again, it will shows error as demonstrated here:
    http://upload.ximnet.com.my/huisheng/list_view_details.swf

    What could be the issue?

    Thanks.





  2. Answer
    Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 04 Dec 2014 Link to this post

    Hello XiMnet,

    from what I see, you are calling kendo.bind each time the detail view is displayed (in the show event). This is not supported and most likely causes the error you are facing. Instead, you should assign the detail record to the existing view model object - this will rebind the view. 

    A very similar approach is implemented in the sushi application - check the detail view show handler.

    Regards,
    Petyo
    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. XiMnet Malaysia
    XiMnet Malaysia avatar
    46 posts
    Member since:
    Jan 2006

    Posted 08 Dec 2014 in reply to Petyo Link to this post

    Hi Petyo,

    I have updated the fn_show_detail as following: However, I got item is undefined.
    Is this the correct way?
    Thanks.

    var id = parseInt(e.view.params.id),
    item = sample_listviewMS.Kendo_DataSource.get(id);
    sample_listviewMS.set("currentItem", item);
    alert(item);
  5. XiMnet Malaysia
    XiMnet Malaysia avatar
    46 posts
    Member since:
    Jan 2006

    Posted 09 Dec 2014 Link to this post

    Hi Petyo,

    Please ignore my question above.
    I have solved the issue.

    Thanks.
  6. Jaime
    Jaime avatar
    60 posts
    Member since:
    Mar 2013

    Posted 08 Jan 2015 in reply to XiMnet Malaysia Link to this post

    And would you like to share your solution so that others might benefit from the answer?
  7. XiMnet Malaysia
    XiMnet Malaysia avatar
    46 posts
    Member since:
    Jan 2006

    Posted 08 Jan 2015 in reply to Jaime Link to this post

    You may check my sample listview JS file:
    http://telerik.ximnet.com.my/kendo_test/js/sample_listviewMS.js
Back to Top
Kendo UI is VS 2017 Ready