when click on Logout button and Login with new User old List should be replaced with new

2 posts, 0 answers
  1. Radhika
    Radhika avatar
    8 posts
    Member since:
    Nov 2012

    Posted 28 Aug 2013 Link to this post

    hello all,
      In mobile application when i click on Logout button and Login with new user list should bind with new data not with the old data.
    Below is the sample code

    <li>
                                <div  id="btnLoginSubmit" type="button" data-role="button" data-bind="click: Login" data-click="Login"  class="submit-btn">Log In</div>
                            </li>

    <div style="float:right;color:white;" >

                            <a data-align="right" data-rel="drawer" data-click="Logout" data-role="button" class="back-btn" id="btnLogout" >Logout</a>
                        </div>

    function Logout(e){
       
        app.navigate("#vwLogin");
       
      
    }

    function Login(e) {
    UserName = $("#txtUserName").val();
    Password = $("#txtPassword").val();
       
    if (UserName != "" && Password != null) {
    app.showLoading();
    $.ajax({
    type: 'GET',
    contentType: "application/json; charset=utf-8",
    url: ServiceURL + "/Login",                        //Service URL
    data: {Email:UserName,password:Password},          //Passing parameters
    dataType: "jsonp",
    success: OnLoginSuccess,
    error: OnLoginError
    }); 
    app.hideLoading();
    }
    else {
    alert("User name and Password are required.");
    }
    function OnLoginSuccess(data, status) {
        
    if (data != null) {

    userData = data[0];  
          
    app.navigate("#tabstrip-openwo");
                

    }
    else {
    alert("Invalid Username/Password...");
    }
    }
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 30 Aug 2013 Link to this post

    Hello Radhika,

    You can invoke the refresh method of the Kendo UI ListView that would reload the data in the ListView.

    Regards,
    Steve
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
Back to Top