It looks like you're new here. If you want to get involved, click one of these buttons!
Hellooooo,
Hmmm... joRecord extends joDataSource, which has a setData() method. You could call that and pass in an initial state object. Careful you don't pass in the same "cleared" object more than once though, because it'll have data after it gets used. Really, it needs a clear() method. Problem there is, you might want different default values for a "clear" state than, say, all nulls.
Well thanks for the reply Dave. I'm at home for the weekend now until Tuesday so I'll look at my code when back in work.
I did manage to come up with an untested solution. Untested because I wrote it right before I left work ;) I think in cases where I wanted particular parts of a records data to be changed but not others I called myRecord.getDelegate('myproperty').setData(newData); but can't quite recall. In other cases I think I just created a new object e.g. UserData = new joRecord({blah : "days"}). Not sure it's working though because when I log back in some data is still displayed. I created a reset() function in each view and each model I needed to clear. Then upon logout() I call a reset function In my main controller that in turn calls all the individual reset() functions.
Anyway I'll test more on Tuesday. I'm nearing completion of our app and I'm glad I found Jo, it made life much easier. Well done Dave. I only wish my JavaScript and software skills were sufficient to contribute. Perhaps in time? I think if a community got behind it and there were more frequent releases it would fly!
Ciao, JP
Hi Dave (et al),
Sony havent got back to me app yet but I noticed running my phone the UI isn't being cleared. I really must investigate later. Quick question:
I think for some records I was just assigning a new record. Unfortunately the data was still there in the Ui. Perhaps set data is the better option?
Essentially upon log out I want the ui to be cleared of all data. It's a financial app and I want the data to be securely retrieved every time the user logs in.
So setData is what I'll try later. But any other suggestions would be appreciated! :)
Cheers, JP
Hello,