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

Where is "Add Record? #70

Open
MGA555 opened this issue Apr 21, 2015 · 9 comments
Open

Where is "Add Record? #70

MGA555 opened this issue Apr 21, 2015 · 9 comments

Comments

@MGA555
Copy link

MGA555 commented Apr 21, 2015

The video for version 1.4 illustrated how to implement the "Add Row" feature. However, I tried that and could not see that anything happened. I also noticed in your notes, that "Add Row" is listed as an enhancement to be included in version 3.0 I looked through the commits here, and did not see where the feature had been removed, but I realize that it could of been removed earlier than the first commit listed here. Do you have the ability to add a row/ to me that is a critical capability.

@MGA555 MGA555 changed the title Where is "Add Recird? Where is "Add Record? Apr 21, 2015
@optikalefx
Copy link
Owner

Adding a record was removed, and as of now I have no plans to add it back. Why? Because I never used it. I always needed something more advanced in my use. I would either a) need a dialog box with a form b) use a new page with a form or c) needed some custom processing before adding. Since there were just so many "non grid" cases for adding, I made it so that you can 1) add a button to add and 2) refresh the grid with previous params so that after your add, the grid is reloaded.

So TL;DR you should make your own add however you need to, and refresh the grid afterwards.

@MGA555
Copy link
Author

MGA555 commented Apr 21, 2015

Thanks for the information.

I'd like to request you reconsider at a minimum including the ability to have a simple "Add a null record" button. My customers need to add records all the time, so within the original spirit and PR of OpenJS Grid, having users need to "roll their own" on this seems inconsistent with your declared goals for this product.

Even if someone did not want to have all the fields editable on the normal page, an "Add record" button could be used to take them to a different page, one where editing has been enabled, strictly for the purpose of adding a record. Any limitations and controls on who could access that page could nicely be left to us.

Thanks for considering.

@optikalefx
Copy link
Owner

What would the benefit be of a null record? 9 times out of 10 it wouldn't even show up in your grid. (Because the grid normally has where conditions limiting what has been selected). So you'd add a null record to your database and then nothing would show up on the grid. (most likely)

@MGA555
Copy link
Author

MGA555 commented Apr 21, 2015

In my cases, there is always an ID, and usually a field that has a default value, so a "null record" is not really null, and they would be displayed. It would be a minor imperfection if you were required to display the Index to be able to use the feature I propose.

How did it work in version 1.4?

@optikalefx
Copy link
Owner

In V1.4 I added a null record. But in almost all cases it wasn't enough. I either needed to process something on the record first, or I needed to ask more data and it was a bad UX to add a record and then open a form. Or I needed to add data to more than 1 table at once, so adding a null record would only do half that job.

Sure adding a null record works for the simplest of cases, but once you start using the grid in real bigger projects, you never will use that simple case.

@MGA555
Copy link
Author

MGA555 commented Apr 22, 2015

Not to be argumentative, but to provide you feedback from users, I will always have the simple cases, even when I start using the grid for bigger "projects". I have a number of eCommerce websites, and since the developer did a good job or normalizing the database, the are lots of simple tables, each of which potentially needs simple maintenance actions.

Also, if I can do half the job, in 2 simple steps I am done. As things currently stand, I need to get back to a somewhat distasteful (especially after achieving simplicity in the other areas) task to create code to add records.

Please reconsider this.

@optikalefx
Copy link
Owner

I can consider it, the PHP part of the code is actually still there in grid.php. It would only be a matter of adding an option to add the button that calls the method. So it's just a matter of adding a little javascript.

@optikalefx optikalefx reopened this Apr 22, 2015
@MGA555
Copy link
Author

MGA555 commented Apr 22, 2015

That would be great. Is there a commit on GitHub that "removed" that feature. I would be very happy to "turn it back on" in my local repo, and create a pull request if you wanted it.

@optikalefx
Copy link
Owner

1.4 to 2 was a total rewrite. So it's not gonna be that simple.

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