Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field type: array #68

Closed
tabacitu opened this issue Jul 23, 2016 · 5 comments
Closed

Field type: array #68

tabacitu opened this issue Jul 23, 2016 · 5 comments

Comments

@tabacitu
Copy link
Member

  • The value is stored as a json in the db: {"a":1,"b":2,"c":3,"d":4,"e":5};
  • The user can add/edit/remove multiple array entries;
  • The entries are stored in a hidden input, then saved to the db;
  • The field should probably look something like this:

================= [ - remove ]
================= [ - remove ]
================= [ - remove ]
[ + add new item ]

It would work GREAT with the new 'array' column type.

Possible issues:

  • what if the user only edits this, then does not focus out of the field and just clicks "save"? maybe the hidden input should be saved on each key stroke...
@tabacitu tabacitu added this to the 3.2 - maturity milestone Jul 28, 2016
@OwenMelbz
Copy link
Contributor

I've done some bits like this before, so should be able to pick it up, I'm thinking maybe to get angularjs packaged with the app, which will allow us to write cleaner field/column code, especially things like this

@tabacitu
Copy link
Member Author

Ehm... I don't know... right now Backpack doesn't require you to know any JS frameworks to completely understand and customize it. And I personally think that's a plus. Because:

I say, let's wait for more stuff to need Angular before we decide we need it. The functionality above can be done using jQuery too, but I do understand what you're saying - it definitely won't be as clean...

@OwenMelbz
Copy link
Contributor

I would expect the users to have to know angular, they would still configure it via the attributes within the crud controller, they wouldn't ever know what was under the hood unless they dived in.

The main reason for this suggestion for this request is the repeatable functionality you'd get very easily and quickly

@tabacitu
Copy link
Member Author

Yeah, I understand, but I don't find this a complex functionality at all to code using jQuery, it's just a "clone". Let me sleep on it, I may be oversimplifying it in my head now :-)

We also need to take this future functionality into account when making a decision about this.

@OwenMelbz
Copy link
Contributor

OwenMelbz commented Sep 23, 2016

I've added a pull request in for this as I needed the functionality today anyway :) #132 - this also works as the matrix functionality you're thinking about

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants