PDA

View Full Version : [CLOSED] Disable Editor grid row



AmitM
Aug 18, 2013, 7:53 PM
I have a grid similar to:
http://mvc.ext.net/#/GridPanel_ComponentColumn/Editor/

How can I disable editting of a row based on a value in the store? It would also need to be greyed out.

I've seen other solutions on the forum which included hiding the row (this row needs to remain visible) or disabling selection (which doesn't work since users are not selecting the row, they are changing cell values) or the edit is canceled (which does not work here since the edit boxes are already showing).

Thanks,
Amit

Baidaly
Aug 19, 2013, 7:13 AM
Hello!

You should use BeforeBind event:


Html.X().ComponentColumn()
.Editor(true)
.DataIndex("IntField")
.Flex(1)
.Text("Integer")
.Component(Html.X().NumberField())
.Listeners(l => l.BeforeBind.Handler = "if (e.record.get('IntField')%2) e.config[0].disabled = true")

AmitM
Aug 19, 2013, 12:52 PM
Will



e.config[0].disabled = true


Disable the entire row or do I need to do this for each column?

Daniil
Aug 19, 2013, 12:57 PM
It applies on a current ComponentColumn only, which a BeforeBind listener is defined to.