how to refresh my itemlist in winapp when I insert a new data in sqlite (javascript & html) -


i insert new data sqlite (with buttonclick) , how refresh itemlist can see new data without restart app. use javascript&html make win8app.

i didn`t use databinding in app.

 // because we're doing rendering, need put data item.         // can't use databinding.         result.getelementsbyclassname("item-image")[0].src =currentitem.data.backgroundimage;         result.getelementsbyclassname("item-note-day")[0].textcontent = currentitem.data.noteday;         result.getelementsbyclassname("item-iconclassimage")[0].src = currentitem.data.iconimage;         result.getelementsbyclassname("item-notetitle")[0].textcontent = currentitem.data.notetitle;         result.getelementsbyclassname("item-noteexcerpt")[0].textcontent = currentitem.data.notecontent;         return result; 

what want when click button insert data sqlite , listview refresh can see datas include new one. , successed insert data sqlite.

sorry im chinese, first time ask question in english. dont no clear or not? if can me,thank you.

with sqlite component, there 2 approaches. first, simple one:

  1. use itemdatasource provided component (see unit tests sample)
  2. call invalidateall on when data changes. either listener registered insert events on database or via application-specific events trigger it

the problem here of course reload whole list. if want have dynamic list doesn't hit database each update, second approach implement own ilistdatasource interface, can become more complicated. did our app , working on abstract , reusable version of pet project of mine unfortunately can't give schedule on when ready release...


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -