- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm creating some forms that rely on the ability to delete or update an individual record in a KV store. Walking through the KV store tutorial, Step 5 for creating the DELETE functionality does not seem to work. Does anyone with experience using KV stores know what the issue could be? I've copied the code verbatim from the tutorial. I can fully manipulate the records using curl
, however, using the method described in the tutorial fails without an error that I can find.
//
// DELETE BUTTON
//
// Call this function when the Delete Record button is clicked
$("#deleteRecord").click(function() {
// Get the value of the key ID field
var tokens = mvc.Components.getInstance("default");
var form_keyid = tokens.get("KeyID");
// Delete the record that corresponds to the key ID using
// the del method to send a DELETE request
// to the storage/collections/data/{collection}/ endpoint
service.del("storage/collections/data/mycollection/" + encodeURIComponent(form_keyid))
.done(function() {
// Run the search again to update the table
search1.startSearch();
});
});
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Ok, I found the issue in tutorial, add
return false;
as the last statement of deleteRecord button handler, so it should be like
$("#deleteRecord").click(function() {
// Get the value of the key ID field
var tokens = mvc.Components.getInstance("default");
var form_keyid = tokens.get("KeyID");
// Delete the record that corresponds to the key ID using
// the del method to send a DELETE request
// to the storage/collections/data/{collection}/ endpoint
service.del("storage/collections/data/mycollection/" + encodeURIComponent(form_keyid))
.done(function() {
// Run the search again to update the table
search1.startSearch();
});
return false;
});
This will prevent browser to submit the page (and do refresh of the page) which prevents current page to submit AJAX call before page reload.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Ok, I found the issue in tutorial, add
return false;
as the last statement of deleteRecord button handler, so it should be like
$("#deleteRecord").click(function() {
// Get the value of the key ID field
var tokens = mvc.Components.getInstance("default");
var form_keyid = tokens.get("KeyID");
// Delete the record that corresponds to the key ID using
// the del method to send a DELETE request
// to the storage/collections/data/{collection}/ endpoint
service.del("storage/collections/data/mycollection/" + encodeURIComponent(form_keyid))
.done(function() {
// Run the search again to update the table
search1.startSearch();
});
return false;
});
This will prevent browser to submit the page (and do refresh of the page) which prevents current page to submit AJAX call before page reload.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Which version of Firefox are you using? I just verified with 36.0.1 and 38.0a2 (2015-03-10) for Mac - works fine for me.
Could you just try to use this page from latest step and see if it works? http://dev.splunk.com/view/SP-CAAAEZ2
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using 35.0.1 on Windows 7, and I copied the code from that link verbatim and I'm still having the issue where records persist when I try to delete them.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Could you debug it?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I looked through the developer console during the process and I didn't see any errors. I didn't see the request go out for the delete operation either, but I'm not sure whether I should since its making a REST call on the local system.
