Domanda

Here is my code for kendo mobile ui datasourse

var pdata = new kendo.data.DataSource({
      transport: {
        read: {
          url: '@Url.Content("~/Message/GetList")',
          type: "post",
          dataType: "json",
          contentType: 'application/json; charset=utf-8'
        }
      }
    });

I Bind this datasourse to a listview template 


    $("#inbox").kendoMobileListView({
                dataSource: pdata
                template: $("#inboxItem").text(),

            })

Now I need a callback function which is called after listview template is bind through datasourse. If I simply call my function after this code the function is called before the template is bind because of asynchronous nature of ajax hit to the server .How to implement callback functionality here .I dont want to use delay here to call my function.

È stato utile?

Soluzione

You can use the dataBound event of ListView for this:

$("#inbox").kendoMobileListView({
                dataSource: pdata
                template: $("#inboxItem").text(),
                dataBound: function(e){
                alert('Now the listview received data from the datasource');

}
            })
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top