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

Debugging Kendo ListView in Firefox Problem

3 Answers 139 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matt Miller
Top achievements
Rank 1
Matt Miller asked on 23 Nov 2013, 02:09 PM
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.


3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 25 Nov 2013, 12:45 PM
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!
0
Matt Miller
Top achievements
Rank 1
answered on 25 Nov 2013, 02:45 PM
http://jsbin.com/iGEmEVUP/4/edit

i think this is what  you want. Thanks again

0
Alexander Valchev
Telerik team
answered on 26 Nov 2013, 03:17 PM
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!
Tags
General Discussions
Asked by
Matt Miller
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Matt Miller
Top achievements
Rank 1
Share this question
or