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

How to pass parameter in Listview

0 Answers 245 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Ammar
Top achievements
Rank 1
Ammar asked on 23 Jul 2012, 08:13 PM
how can i pass parameter to service method..here is my code

Service Method which accept the argument

  public string AllBooks(string models)
  { 
                return models;
  }

KendoListView Binding Script
$(function () {
            var id = "ammar";
            var dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        type: "POST",
                        url: "../../books.svc/AllBooks",
                        dataType: "json"
                    },
                    parameterMap: function (options, operation) {
                        if (operation == "read") {
                            return { models: kendo.stringify(id) };
                        }
                    }
                },
                schema: {

                    parse: function (data) {
                        return JSON.parse(data.d);
                    }
                },
                pageSize: 8
            });

            $("#listView").kendoListView({
                dataSource: dataSource,
                template: kendo.template($("#template").html())

            });

        });
   
service method not call,in firebug i saw Post tab when service method call following is the format which is going to be pass,i think this is the reason why service method not call..please someboy tell me where i m wrong

No answers yet. Maybe you can help?

Tags
ListView
Asked by
Ammar
Top achievements
Rank 1
Share this question
or