-
Notifications
You must be signed in to change notification settings - Fork 743
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
DataTable: Row/CellEditor should disable inputs to avoid post parameters #3571
Comments
Disabling the fields by row/celleditor is also a way to prevent the datas from posting ... |
#3564 is a separate issue. Not related to Row/Cell editing. I posted a 'fix' there (sorry, no time, or rather currently no environment to make a PR) |
Disabling the fields makes it harder for aria stuff I think... and when you disable it for real and not for aria that might become a problem. I'm not in favour of solving it that way. Making the row/cell editor do a real partial submit is the better way. I'm already looking into these |
I'm a noob in ARIA ;) but it feels the right way as the inputs are not enabled per default actually, only when you enter the edit mode. |
Technically they are enabled, just not visible which is for the visibly impaired not relevant. If you disable them technically but (most likely) need them not disabled for the visibly impaired, you get too much conditional stuff which makes an (at least certainly in your eyes) complex component even more complex (or is it even worse and you need to do it in all components? Would not want to go that way. Let's see if a partialSubmit on the events might help. I saw you committed a fix but reverted it? |
Yes, i didn't like that fix. I would evaluate if dynamically disable/enable all :input elements via jquery could work. |
I think you can use a jquery selector to find all inputs of a certain row and add that as a value to the process attribute. This leaves all other required fields in there. So the idea of your fix was not that weird... (imo)... might need a little tweaking... |
What's about something like this: 1.) In general render all datatable input-fields with the readonly tag - e.g. disabled="disabled"
2.) When you enter the edit-mode (row or cell) you remove the disabled-tag
3.) When the AJAX-Post has been finished you should re-enable the disabled-tag:
|
Disabling all input-fields by default can also be done by Only add this to the bindEditEvents-Function works
bindEditEvents: function() {
var $this = this;
this.cfg.cellSeparator = this.cfg.cellSeparator||' ';
this.cfg.saveOnCellBlur = (this.cfg.saveOnCellBlur === false) ? false : true;
// Set all fields to disabled by default:
$(".ui-cell-editor-input").children().prop("disabled", "true"); So with only adding this also the AddRow issue #3564 I tried it with the showcase and instead of sending 1000 url encoded parameters |
Although it might work, with the things you tested, it still is in my
opinion a workaround with a number of loose ends.
- It is undetermined how it would be for the visually impaired.
- How is the behaviour is someone actually wants to have a disabled input
in one of the fields? Or already has (backwards compatibility)
- What if you have more than a couple of fields (performance)
- The solution differs for other components.
- Setting the inputs to disabled results in a different state between the
PF wrapped component and the underlying real component.
The fix Thomas created and withdraw wasn't a bad start
|
Yes, it's currently a workaround, This is currently a big show-stopper for us and our software which is planned to go
What's the withdraw - fix ? |
I think i found out another solution which is also working 1.) Using a data- attribute to mark all input-fields in the data-table So default no datas of the datatable are posted as params to the server This currently works for AddRow and Posting, |
Would only work for ajax posts. IMO the cleanest solution is that the roweditor will really enable/disable the inputs. |
Yes - that's the cleanest solution, but how to handle if the user already disabled an input |
If only disabling all fields by default this is quite simple by using jQuery:
... on the initalizing of the datatable. |
Exactly
|
Jikes... "Cleanest solution"???? No way... IMO a terrible hack. The I currently don't have the time but I'll create a clean patch tomorrow or in the weekend (or maybe even tonight) in line with the original one by Thomas but smaller... |
Oh, and what if in the process other inputs are updated? Then you lose the status... Adding/manipulating other inputs this way is NOT clean... Sorry... |
Ok ok, but you will never fix all issues then ;) If the datatable is processed by ajax or posted by non-ajax, there is no way to fix it. |
Partial submit and update of single rows is a great feature to have |
see #3570
see #3564
see #3562
see #2008
The text was updated successfully, but these errors were encountered: