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

Kendo read url/ListView not working

4 Answers 250 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jayaram
Top achievements
Rank 1
Jayaram asked on 06 Apr 2016, 10:43 PM

Hi,

Below is my code in which URL is not routing to Controller page.Here domain is my local system URL.there is a div tag with id = detailId.trim() (detailID value is dynamically created while loading the web page).Can someone help me here.

 function detailInit(e) {
    
        var detailRow = e.detailRow;
        var detailId = detailRow.find(".catNumber").text();

   var dataSource1 = new kendo.data.DataSource({
            transport: {
                read: {
     url: domain + "Ethno/GetMediaMetaData",
                    data: { id: '' + detailId.toString() },
                    dataType: "json"
                   
                }
            },
           
            parameterMap: function (options) {
                return kendo.stringify(options);
            }
        });
      
            $("#detailListView_" + detailId.trim()).kendoListView({
                dataSource: dataSource1,
            template: kendo.template($("#detailMediaTemplate").html()),
            selectable: true,
            change: onChange
        });
        
    }

4 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 11 Apr 2016, 07:36 AM
Hello Jayaram,

I am not sure why exactly the controller is not being reached. I would recommend checking the browser's console and network tab for any messages that might give us a clue. Also, it's worth checking if the controller allows GET requests, which is what the DataSource will create by default.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jayaram
Top achievements
Rank 1
answered on 11 Apr 2016, 04:07 PM

Hi Alexander,

Thankyou for your response.When I have checked the browser's console,I have found out error:

Uncaught Error: Syntax error, unrecognized expression: #detailListView_E/1930/1/1     jquery.min.js:4.

Here my input is: E/1930/1/1

Could you kindly help me with this error.

 

Regards,

Jayaram

 

 

 

Attaching the file for your reference

0
Alexander Popov
Telerik team
answered on 13 Apr 2016, 08:34 AM
Hi,

This happens because the slashes in the input cause the jQuery selector to generate an invalid expression. I would suggest either wrapping the ID selector in quotes or escaping the slashes using replace. Here is how the selector should look like after the changes: 
//Desired result:
$("[id='detailListView_E/1930/1/1']")
$("#detailListView_E\\/1930\\/1\\/1")


Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jayaram
Top achievements
Rank 1
answered on 19 Apr 2016, 08:33 PM
I worked..thanks foe your help
Tags
General Discussions
Asked by
Jayaram
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Jayaram
Top achievements
Rank 1
Share this question
or