Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Favorites - Database

$
0
0

Hi all,

I have the below code for favorites fuction. My goal is how to: update the button with other image and other alert msg if is already added.

fav_btn.addEventListener('click', function (e) {
   var db1 = Titanium.Database.install('database.sqlite','database.sqlite');
       db1.execute('INSERT INTO favourites (entry_name) VALUES(?)',c_name);
 
    var alertDialog = Titanium.UI.createAlertDialog({
        title: 'Test App',
        message: 'Entry is added to favorites.',
        buttonNames: ['OK']
    });
 
        alertDialog.show();
        db1.close();             
 });

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>