Petras
Petras

Reputation: 4759

Is their a technique to create and delete content with Aloha?

I understand how the Aloha editor works, users click on some content in a live web page, edit it and save the content to a repository via ajax. This is fine for content editing, the U in CRUD.

But how do you get the *C*reate and *D*elete in CRUD?

Imagine this scenario.

A web page displays a list of people with first and last names. They can be edited with Aloha, no problem.

But how do you add a new person in the list via the Aloha editor? Since it is only for editing content, you can't add new content. Similarly for content deletion, how do you delete a person from the front end, I mean completely remove the database row for that person somehow, not just put in a blank for their name.

Is their a technique or plugin for this?

Upvotes: 0

Views: 378

Answers (1)

csupnig
csupnig

Reputation: 3377

you are completely right that Aloha Editor is a WYSIWYG Editor for editing content, meaning that the user can change the DOM in the browser. The actual CRUD operations have to be done by the application that uses the Aloha Editor.

To create new content, you could just add a div via jQuery and make it editable via Aloha. You can then trigger an Ajax request, that saves/creates the new item in the backend.

Same goes for deleting items. You just add a button that triggers an Ajax call to delete the item in the backend.

BR, Chris

Upvotes: 1

Related Questions