PDA

View Full Version : [CLOSED] Block Grid while RowEditing plugin visible



aluna
Jan 06, 2020, 3:41 AM
Hello,

Please, refer to example https://examples5.ext.net/#/GridPanel/Plugins/RowEditor/.
How to block the grid and avoid sorting, filtering, moving the editor while the RowEditing plugin is visible?

In Ext.Net v1 I used to disable the grid and RowEditor remained enabled, in v5 if I disable the grid, RowEditing plugin get disabled too (it allows typing but no save or cancel).

Thanks

fabricio.murta
Jan 06, 2020, 3:22 PM
Hello Alex,

What about just disabling the header line while the editor is on? You could bind the beforeEdit event for disabling and edit plus cancelEdit events to re-enable it.

I'd say by disabling the grid the row editing fields were supposed to be disabled as well, so at least the update/cancel buttons being disabled is concise with the component's state.

To disable moving the editor row, it would be required to extend the component, unfortunately. If you disable the view, the row editor gets disabled as well. What you could do with the least changes is set the ClicksToMoveEditor setting (https://docs.sencha.com/extjs/7.0.0/classic/Ext.grid.plugin.RowEditing.html#cfg-clicksToMoveEditor) to '2' (only valid values are '1' or '2'), so it gets 'harder' to move around once editing.

Hope this helps!

aluna
Jan 06, 2020, 8:41 PM
I was trying with a spotlight as suggested here https://forums.ext.net/showthread.php?32441-CLOSED-Grid-Panel-CellSelectionModel-with-RowEditing-Plugin but RowEditing doesn't have a view, or it does?

By the way, what's the substitute for grid.getRowsValues()?
In v1 I use
grid.getRowsValues({filterRecord:grid.filters.getR ecordFilter()}) to get records according to grid filters applied and
grid.getRowsValues({selectedOnly:true}) to get selected records. But didn't find the related breaking change.

Thank you

fabricio.murta
Jan 07, 2020, 4:03 PM
I was trying with a spotlight as suggested here https://forums.ext.net/showthread.ph...Editing-Plugin but RowEditing doesn't have a view, or it does?

The view referred to in the thread you pointed is the grid's view. The idea there was to gray everything but the grid cells.

This would, indeed, achieve the objective of being unable to switch ordering or filtering -- but won't prevent from switching to other rows.

So, in the same sense as our previous post, you'd define a spotlight on the page and, assuming it is ID="SpotLight1", add these listeners to the RowEditing plugin:



<BeforeEdit Handler="App.SpotLight1.show(this.view);" />
<Edit Handler="App.SpotLight1.hide();" />
<CancelEdit Handler="App.SpotLight1.hide();" />


The editor's visible component is displayed after the beforeEdit event, so trying to just spotlight the row editor element won't do. Another event would need to be implemented to handle the editor availability state (like a onRender or something like it), and currently I don't think there is such event. It may be possible, though to find other means to attain this, let us know if that's what you need to complete your view, and we'll think a way through that.


By the way, what's the substitute for grid.getRowsValues()?

The method still exists, if you need further info on that topic, would you mind opening a new thread?

Hope this helps!

fabricio.murta
Jan 24, 2020, 6:05 PM
Hello again, Alex!

It's been some days since we last posted here and still no feedback from you. Did our last answer help you at all, or do you still need help with this matter?

We may mark this thread as closed if you don't reply in 7+ days from now; this won't prevent you from posting here afterwards, though, as we don't lock up the thread once the tag is in place.

Looking forward to your feedback!