allcount / allcountjs

Rapid application development framework for Node.js
http://allcountjs.com
MIT License
402 stars 83 forks source link

Is is possible to disable 'Edit' button in grid view? #117

Open nick13jaremek opened 8 years ago

nick13jaremek commented 8 years ago

When in grid view, we are showing only a subset of the fields for a given Entity type. Then we click on the 'Edit' button and attempt to save one Entity row. We cannot confirm the edition because some of the required fields are not visible in the grid view.

Of course, when editing the Entity item in the complete view (having access to the fields) no issue appears.

The most straightforward solution would be to remove the 'Edit' button from the grid view. Is this possible?

paveltiunov commented 8 years ago

@nick13jaremek yep. This is the case where additional effort is required. The most simple way to remove this button is to override

mixin startGridEditingButton()
nick13jaremek commented 8 years ago

@paveltiunov Thank you for the response! However, I am still stuck with no luck :(

I tried the following:

// Custom views
injection.bindMultiple('viewPaths', ['myViewPathProvider']);
injection.bindFactory('myViewPathProvider', function () {
  return [path.join(__dirname, 'views')];
});

extends main
include mixins
mixin startGridEditingButton()

However, I haven't seen the edit button disappear in the grid views. Perhaps I am missing something? A configuration parameter perhaps?

I also tried renaming the main.jade file to mixins.jade and entity.jade (replacing extends main with extends mixins and extends entity respectively) but haven't achieved success.

Any help with this would be very welcome.