Dynamic Data and Edit Mode

Vote:
 

Hi guys,

I gather the best way to store tabular data in EPiServer is by using the Dynamic Data Store, but how could I allow editors to create new and edit current rows in my tabular data from within Edit Mode?

Here is my example: I need to store employee information. Each employee has the following information...

Name, Age, Role, Salary, Email Address

...obviously I can create a Data Store called "employee" with these fields, but how do I allow editors to add new employees from within Edit Mode, delete employees and edit them too?

I gather there is a plugin to allow the editing of all Dynamic Data within EPiServer but I don't want editors breaking something by editing a Data Store I do not wish for them to see.

Any help greatly receieved :-)

Chris

#76197
Oct 18, 2013 19:54
Vote:
 

Agreed - don't give your editors access to an admin-level DDS tool.

I'm interpreting your question as wanting to build a datagrid view which supports inline editing, so you can change cells in each row with save/update/delete functionality, kind of like Excel. Apologies if my interpretation is off.

Creating an editable grid should be fairly easy - roughly:

  • Create an Employee class with all the required properties, and create a new DataStore with typeof(YourEmployeeClass)
  • Create a new page template (content type) that contains a grid-type webcontrol, like a simple asp:datagrid or one of the many jQuery grid libraries that allow inline editing. Most of them have demos showcasing this functionality along with CRUD operations. This page should be in a protected part of your site only available to editors with the required access level.
  • Load your DataStore containing employees and bind it to your datagrid.
  • On each CRUD event, update your DataStore and rebind your grid control.
  • (Editors would be working with this page in its published state, not in On-Page or Forms-Edit mode.)

That should get you started, though there are probably sexier ways to do it. 

 

#76199
Oct 19, 2013 1:43
Vote:
 

Thanks Arild.

That should work OK if I am able to allow them to create new records too.

Is there a way to allow editors this functionality from with the CMS area, rather than using a published page in a new area of the site? I'm hoping I can keep everything together in one place you see.

#76219
Oct 21, 2013 10:59
Vote:
 

Maybe this will help?

http://joelabrahamsson.com/custom-rendering-of-content-areas/

Limiting the CRUD functionality to only be available when PageEditing.PageIsInEditMode is true may be the way forward?

#76351
Oct 22, 2013 18:00
Vote:
 

Thanks, I'll give it a whirl :-)

#76384
Oct 23, 2013 16:35
Vote:
 

If you need edit functionality I would probably store employees as pages/container pages. If it is a "fair" amount of employees that is. :)

#76387
Oct 23, 2013 16:52
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.