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

How do I get the ListView refresh after adding content?

1 Answer 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Suma
Top achievements
Rank 1
Suma asked on 26 Aug 2013, 02:24 PM
hi,

i have a listview with tab strip. its will appear after login. i am adding some records after adding i want to refresh the listview. for this i am rebinding the listview. here i got the issue after rebind listview items click event not working. anyone can help me in this issue i posted this one month before also still now i am struggling in this issue due to this issue i am unable to go further.

with regards
sumalatha

1 Answer, 1 is accepted

Sort by
0
Accepted
Suma
Top achievements
Rank 1
answered on 30 Aug 2013, 05:45 AM
Hi,

  at the last i got the solution my self after doing so much enhancement. i am posting here my code it will be useful to some one
you just create method and cal the method where you need to refresh the listview. it will be refresh.
function ReloadListview(e){
    app.showLoading();
    $.ajax({
        type: 'GET',
        contentType: "application/json; charset=utf-8",
        url: ServiceURL + "/yourmethodname",
        data: {EMail:your parameter1,Password:userData.Password}, //Data sent to server
        dataType: "jsonp",
        success: function (data, textStatus) {
            if (textStatus == "success") {
              
                var ds = new kendo.data.DataSource({
                      data: data
                    });
                  $("#lstyourlistviewid").data("kendoMobileListView").setDataSource(ds);
                  $("#lstyourlistviewid").data("kendoMobileListView").refresh();
              
                
            }
        },
        error: function (data, textStatus) {
            alert('An error has occured!');
        }
    }); 
}

with regards,
suma
Tags
General Discussions
Asked by
Suma
Top achievements
Rank 1
Answers by
Suma
Top achievements
Rank 1
Share this question
or