Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9274015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:15:09+00:00 2026-06-18T16:15:09+00:00

I need to restart my app everytime I insert,delete or update my data. Data

  • 0

I need to restart my app everytime I insert,delete or update my data.
Data is inserting and deleting properly…but dont know why i need to restart my app everytime to get the effect.

I want to use the file structure for this app.

<script type="text/javascript" charset="utf-8" src="js/cordova-2.1.0.js"></script>
<script type="text/javascript" charset="utf-8" src="js/lawnchair.js"></script>
<script type="text/javascript" charset="utf-8" src="js/dom.js"></script>
<script>
    $(function(e) {

        var details = Lawnchair({name:'details',adapter:'dom'},function(e){
            //this.nuke();
        });

        details.all(function(data){
            for(var i = 0; i<data.length;i++)
            {
                //alert(data.length);
                var id = i + 1;
                //alert(id);
                document.getElementById("id").value = id;
                var listdiv = document.createElement('li');
                listdiv.setAttribute('id','listdiv' + i);
                listdiv.innerHTML = "ID : " + data[i].value.id + " | " + "Name : " + data[i].value.name + " | " + "Desc : " + data[i].value.desc;
                $('#show_list').append(listdiv);
            }
        });

        $('#save').click(function(e){
            //alert($.now());
            var obj1 = {id:$('#id').val(),name:$('#name').val(),desc:$('#desc').val()};
            //alert("listdiv" + obj1.id);
            details.save({key:"listdiv" + obj1.id,value:obj1});
            alert("Data Saved Successfully");
            //location.reload();
        });

        $('#del').click(function(e){
        if(document.getElementById("name").value != "")
        {
            var id = document.getElementById("id").value;
            details.remove("listdiv" + id,function(obj1){
                $("input:text").val("");
                document.getElementById("show_list").innerHTML = "";
                alert("Data Removed Successfully");
            });
        }
        else
        {
            alert("Please Select Data");
            return false;
        }
        });

        $('li').live('click',function(e){
            //alert(this.id);
            details.get(this.id,function(obj){
                document.getElementById("id").value = obj.value.id;
                document.getElementById("name").value = obj.value.name;
                document.getElementById("desc").value = obj.value.desc;
            });
        });
    });
    </script>

  </head>
  <body>

  </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:15:10+00:00Added an answer on June 18, 2026 at 4:15 pm

    Because new content has been appended code should look like this:

        details.all(function(data){
            for(var i = 0; i<data.length;i++)
            {
                //alert(data.length);
                var id = i + 1;
                //alert(id);
                document.getElementById("id").value = id;
                var listdiv = document.createElement('li');
                listdiv.setAttribute('id','listdiv' + i);
                listdiv.innerHTML = "ID : " + data[i].value.id + " | " + "Name : " + data[i].value.name + " | " + "Desc : " + data[i].value.desc;
                $('#show_list').append(listdiv);+
            }
            $('#show_list').listview().listview('refresh');
        });
    

    This line has been added (#show_list should be listviews id) :

    $('#show_list').listview().listview('refresh');
    

    If you want to find more about this (how to enhance dynamically added content in jquery Mobile) take a look at my other ARTICLE. Or it can be found HERE in my other answer. Read it carefully because there are numerous ways how his can be achieved.

    EDIT :

    And here’s a fix for your problem: http://jsfiddle.net/Gajotres/3cuPP/

    When you click save button you also need to append new data. In your case I have used all function to get all data, that same data is then appended to listview and refreshed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to restart an app pool from code, does anyone know how to
I need to restart the program that im working on after an update has
I'm trying to catch WM_QUERYENDSESSION to save some data in the app, but it
Do I need to restart the emulator everytime I make an edit to the
Hey gang, I need to know if i need to restart my computer to
I need to restart a windows mobile 6 application. Here is the code I
For different changes I made in my project, I need to restart Git repo
I created a button and I need it to restart the form I have
I need to quit firefox and restart it in order for the applet to
I need some way to monitor a desktop application and restart it if it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.