Debugging Kendo ListView in Firefox Problem

4 posts, 0 answers
  1. Matt Miller
    Matt Miller avatar
    23 posts
    Member since:
    Jan 2012

    Posted 23 Nov 2013 Link to this post

    When i try to step through an event handler for my listview's change event, Firefox locks up. Can not click on any of the debugger menu items. Can't switch back to the console window. Browser becomes completely unresponsive. I am logging to the console window from my event handler, and no errors are mentioned.

    I know this has to be something silly on my part, just wondered if any one else has experienced this problem. 

    Here is the definition of my ListView : 

    var carriers = $("#carrierList").kendoListView({
                selectable: true,
                pageable : true ,
                change: onChange,
                dataBound : onDataBound ,
                dataSource: t94StragglerCarriers,                       
                template : kendo.template($("#carrierTemplate").html())
            }).data("kendoListView");
    Here is the event handler : 
    function onChange() {
               var listView = $("#carrierList").data("kendoListView");
               var index = listView.select().index();
               var item = listView.dataSource.view()[index];
               console.log("Item " + index + " selected. Text = " + item.val);
           }

    Again , this only happens when i try to debug this event handler in firefox.

    Thanks in advance.


  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2895 posts

    Posted 25 Nov 2013 Link to this post

    Hello Matt,

    This is not a know issue. Could you please try to prepare a small but runable jsBin sample which isolates the issue so we can take a look? Please provide such sample and we will check it right away.

    Regards,
    Alexander Valchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Matt Miller
    Matt Miller avatar
    23 posts
    Member since:
    Jan 2012

    Posted 25 Nov 2013 Link to this post

    http://jsbin.com/iGEmEVUP/4/edit

    i think this is what  you want. Thanks again

  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2895 posts

    Posted 26 Nov 2013 Link to this post

    Hello Matt,

    On my side the browser does not locks up. Anyway there are JavaScript errors, the example is not working because the ListView template which you use does not have a single root element.
    You should wrap the content inside a <div> tag which will play the role of a root element.
    <script type="text/x-kendo-tmpl"  id="template">
      <div<!-- root -->
        <div id='carrierListVal_#:id#' class='k-textbox'>#:name#</div>
        <br/>
      </div>
    </script>

    For your convenience I updated the jsBin sample - now the correct items and indexes are loaded.

    Regards,
    Alexander Valchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top