Skip Navigation LinksHome > View Post

RIA/JS: Deleting Entities

I got an e-mail from somebody who had watched the first few screencasts and wanted to know about deletes. Seemed like a good topic for our next screencast so here it is: Deleting with client-side change tracking:

Here’s the source as it’s entered into the console (plus the part that creates the array and datasource that I embed in the page).

var contacts = [];
 
var ds = $([contacts]).dataSource({
  serviceUrl: '/RiaJs-Demo1-ContactService.svc',   
queryName: 'GetContacts',  
bufferChanges: true }); ds.refresh();
contacts.deleteEntity(contacts[1]);
// should output "ClientDeleted"
ds.getEntityState(contacts[1]); // deletes from the DB
// and removes the item from the array


ds.commitChanges();

Next time I hope to start working with some UI!

 
Josh Post By Josh Twist
9:47 PM
17 Oct 2011

» Next Post: Project Liike
« Previous Post: Building SPA Applications - the webcasts

Comments are closed for this post.

Posted by LeeHyungGeun @ 18 Oct 2011 1:16 PM
thank you answer.

it's very hot !!

© 2005 - 2014 Josh Twist - All Rights Reserved.