Question

Following on from - Deep Nested XML

I have a checkbox renderer i am placing into my Datagrid. The checkbox needs to do a sql query on the sqllite database and see if the show is marked as watched, if it is then make the checkbox as checked and if not mark the checkbox and not checked.

What i would like to do further to this is add the watched items to one XMLList and add the not watched episodes to a different XMLList and have the checkbox on click= move from one to the other list as per watched or not.

http://pastebin.org/46383 - sql query class file.

http://pastebin.org/46384 - watchedRenderer file.

http://pastebin.org/46385 - datagrid displaying the checkbox and other info.

Was it helpful?

Solution

1) if you did that you'd have 1 query to select all the shows and then 1 query for each show. This is NOT a good idea. Why not simply make a JOIN with the watched field on the first select query?

2) simply update each datagrid item, and dinamycally generate the 2 xmllists with filterfunctions or loops checking you condition.

OTHER TIPS

Another strategy might be to load your database to the front-end at the start of your program, and then save your data to the back-end at the end of your program. In this way, you can just query each "object.isWatched" in your dataProvider.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top