问题描述
我的colmodel,具有一个列名"count"和一个用于警告更改的editoptions dataEvent.在添加表单中,我要删除此警报,并且仅在编辑模式下需要此警报.所以,我尝试使用setColProp和.attr在添加表单beforeshowform()的过程中做了几件事 但是似乎没有任何效果.任何帮助都将不胜感激.
My colmodel, has a column name'count' and a editoptions dataEvent that alerts a change.In the add form i want to remove this alert and need this alert only in the edit mode..So, i tried a couple of things in the add form beforeshowform(),using setColProp and .attr But nothing seems to work.. any help greatly appreciated.
推荐答案
数据事件" rel ="nofollow noreferrer"> beforeShowForm 为时已晚.您应该在beforeInitData
回调内部进行更改.
Setting of dataEvents inside of beforeShowForm is too late. You should make the changes inside of beforeInitData
callback.
如果您还需要在dataInit
内部使用其他初始化,则可以使用我在此处描述的简单技巧>.在这种情况下,您只需将inEdit
设置为true
或false
并在beforeInitData
回调内部进行设置,并在dataInit
内部进行不同的操作就取决于inEdit
的值.
If you would need additionally to use different initializations inside of dataInit
you can use the simple trick which I described here. In the case you just set any variable like inEdit
to true
or false
and inside of beforeInitData
callback and make different actions inside of dataInit
depend in the value of inEdit
.
这篇关于更改编辑选项,特别是编辑表单jqgrid上的dataEvents的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!