2

I have a site with about 150 users. I am going to implement a system whereby things that they do in the real world (it's a fitness company), such as attending sessions, introducing new customers etc will earn them points.

I would like to create a table with 3 columns:

Name | Points | Update

so something like this: enter image description here

The idea being that my client (editor role) could log in and amend the points that each user has and then click update to modify each row. I guess the table would be equally useful if there were just a single 'update' button at the bottom of the table to update all entries at once.

I don't know how I might go about making a table such as this 'editable', but would really appreciate some pointers as to how you might accomplish this. I would stress that I'm okay with using contributed modules, but quite poor with creating modules and PHP in general!

4

For your requirement Slickgrid is the best option for you and for that you need to use views module.

enter image description here

At the front end, users can show/hide, resize, reorder columns & resize the height of the grid. These settings will be stored per user and used next time the grid is shown. Saving the view (via the usual views UI) will reset these settings.

For every field defined in the view, you can set its column width, whether it's sortable, and formatters (how the cell data is displayed), an editor, a validator and filters (for filtering the column data).

This modules comes with the following plugins ready to use:

Editors:

  • Inline cell editor - for excel-like editing of text & numeric data.
  • Popup field form - the field form pops up in an overlay. All field types can be edited.

Features of the grid:

  • Grouping field - group fields with a common value together
  • Collapsible taxonomy fields (tree structures)
  • Tabs - organise columns into tabs
  • Resize, reorder & hide columns
  • Delete entities via the grid
  • Force fit columns (to fill the available column space)
  • Undo (undo previous changes - uses node revisions)
  • Set viewport height
  • Set row height
  • Add entities via the grid*
  • Clone entities*
  • Export data (via the views data export module)*
  • Multi edit/delete/clone/export (checkboxes will be displayed in the rows - select as many rows as you want to perform action against)***

or as Pontus Nilsson said use this Editable Views module.

|improve this answer|||||
  • Slickgrid just doesn't work, see issue queue. No documentation, lots of critical bugs, not maintained. Sad but true :( – Shevchuk Nov 27 '13 at 13:31
2

Just in case someone else will be searching for solution.

Editable Views module (https://www.drupal.org/project/editableviews) - works good, has only one Save button for whole table (not a row). Cannot be used with non-FieldAPI-based fields (e.g. no Views Bulk Operations and no Weights). Should be good enough for your task.

Editablefields module (https://www.drupal.org/project/editablefields) - works not so good - it saves every field right after it's editing with AJAX. The fast editing of multiple fields may result to data lost.

Unfortunately there's no ready solution to save data per table row.

|improve this answer|||||
-1

You need the WYSIWYG module. Once you have installed the module, you'll need to install an editor, such as CKEditor or IMCE.

|improve this answer|||||
  • Thanks for your answer. I was hoping that the data that was 'updated' might then be saved to the database so that I could then use Views to sort the table so that the users with the most points would be at the top etc. Any more ideas? Thanks for the reply though. – njwrigley Sep 9 '13 at 15:24
  • @njwrigley, if that is what you want, you will need to create a custom content type to represent a row in the table and then create a view to output the table. – Scott Joudry Sep 9 '13 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.