ng-admin icon indicating copy to clipboard operation
ng-admin copied to clipboard

Grid form

Open manuelnaranjo opened this issue 10 years ago • 15 comments

This series of patches adds support for multiple fields in a row as suggested by #448

It's using bootstrap for generating the needed layout.

A configuration example would be:

   var datosPersonales = nga.field('Datos Personales', 'fieldset').
    rows([
      // apellido y nombre
      nga.field(null, 'row')
        .fields([
          nga.field('apellido').attributes({span: 3}),
          nga.field('nombre').attributes({span: 3}),
          nga.field('grupo').attributes({span: 3}),
          nga.field('ficha').attributes({span: 2}),
          nga.field('activo').attributes({span: 1})
        ]),

      // datos de la escuela
      nga.field(null, 'row')
        .fields([
         ....
        ]),
      .....
  ])

manuelnaranjo avatar Sep 02 '15 23:09 manuelnaranjo

Great!

I'm not a big fan of nga.field(null, 'row'). A row isn't a field, so you should provide a nga.row() factory instead.

Also, please update the package.json to point to your admin-config fork for the time being so that the tests have a chance to pass. By the way, you should test this.

Lastly, with every new feature comes a bit of documentation... please contribute that part, too.

fzaninotto avatar Sep 07 '15 21:09 fzaninotto

Mhh the nga.row suggestion makes sense, I'll do that, same for fieldsets, those aren't fields either.

Ok I will change package.json, I haven't though about it before.

Where should I put the docs? Suggestions?

manuelnaranjo avatar Sep 07 '15 22:09 manuelnaranjo

Probably in doc/Configuration-reference.md

fzaninotto avatar Sep 08 '15 07:09 fzaninotto

It's an awesome work, can you help me why I got 'Unknown field type "fieldset".' error? I've changed my ng-admin as shown on your Files changed, but still got that error....

michaelavi avatar Oct 21 '15 09:10 michaelavi

@michaelavi are you using webpack? If not you need to switch to it, as I haven't rebuilt the files on my own branch

manuelnaranjo avatar Oct 21 '15 13:10 manuelnaranjo

Sorry for bumping this, but is this feature is ready to be pulled or needs more work ?

Phocea avatar Nov 18 '15 18:11 Phocea

I've been using it for quite sometime, but the branch needs some cleanup and testing

manuelnaranjo avatar Nov 18 '15 18:11 manuelnaranjo

@manuelnaranjo Any chance of finalizing this? Its a it of a shame that it is left so close to bring some good functionality to ng-admin @fzaninotto Can you share your opinion on what is still mising to finalize this pull request?

Phocea avatar Jan 13 '16 12:01 Phocea

see my comments in the discussion

fzaninotto avatar Jan 13 '16 15:01 fzaninotto

+1 for this.

jefbarn avatar Apr 06 '16 19:04 jefbarn

I'm sorry but I don't have the time right now on fixing this for merging, maybe someone can take over? I can help out, but I can't do my self.

manuelnaranjo avatar Apr 06 '16 21:04 manuelnaranjo

Took at quick look at the merge, but the gotoDetails() and gotoReference() changes make a lot of conflicts.

jefbarn avatar Apr 07 '16 19:04 jefbarn

@michaelavi did you manage to make it work? I'm having the same issue

mohamed5678 avatar Jun 07 '16 12:06 mohamed5678

@fzaninotto Please merge this feature.

thachp avatar Dec 01 '16 03:12 thachp

@thachp it is not possibile in the current state:

  • Merge needs a review, in the meanwhile @fzaninotto added the possibility to have template on labels using a compile attribute, but this remove the class attribute. It is needed to verify if that class is required for this PR. Maybe @manuelnaranjo could have a quick look and let us know the impact

  • PR still need some work as per @fzaninotto previous comments (documentation and nga.row factory in the admin-config code)

Phocea avatar Dec 01 '16 07:12 Phocea