I am using ShieldUI for making an editable Grid on a webpage. A very similar grid can be found at this URL.
My requirement is to make only 1 column editable while keeping the remaining columns as non-editable in the above Grid.
The Documentation of the ShieldUI provides option to enable or disable editing of the whole Grid at a time. However, it provides no option to enable or disable editing at column level.
I could not find any good resource on the web on this topic.
As a possible solution, we can enforce the edit disable using Javascript, but I think that would destroy its simplicity.
How can we achieve this? Any help would be highly appreciated.
Thanks
I was having a similar problem, I used the editorCreating event to enable/disable the default control behavior. I am using row editing in this example.
https://www.shieldui.com/documentation/grid/javascript/api/events/editor-creating
Ex.
events: {
editorCreating: function(e) {
if (e.field == "column_i_want_to_disable") {
e.options = { enabled: false };
}
},
You should be able to cancel the editing on a row by overriding the command event, described here: https://www.shieldui.com/documentation/grid/javascript/api/events/command
Before a row goes in editing mode, an "edit" command is sent, which can be caught by the command event described above.
Inside the event handler you can inspect the row being edited and cancel the editing it if needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With