Deleting a product

The second feature of this application is about deleting a product from the products grid. To implement this feature, we will:

  • Update the products client module to add a method to send a request to the server to delete a product
  • Update the products grid module to add a method to delete a product
  • Update the view to add a new column to the grid that will contain a button for the delete action

Let's get started by updating the ProductsClient module. Open the ProductsClient module in the productsclient.js file and add a method to send an HTTP DELETE request to http://[host:port]/products/{id}. The method should expect the product model and a callback method as parameters. The callback method should get executed on successful response ...

Get KnockoutJS by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.