使用Jquery在Telerik Grid中禁用/ ReadOnly Datetime字段 [英] Disable/ReadOnly Datetime field in Telerik Grid Using Jquery

查看:51
本文介绍了使用Jquery在Telerik Grid中禁用/ ReadOnly Datetime字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我有一个带有一个日期时间字段的telerik网格。我的要求是在编辑方法上对该日期时间字段进行禁用/只读...



这是我的代码...

Hello,

Iam having a telerik grid with one datetime field.My requirement is to make disable/readonly to that datetime field on edit method...

This is my code...

        .Columns(columns =>;
        {         
            columns.Bound(p => p.Mydate).Width(140).Format("{0:dd/MM/yyyy}");
            
        })
      .ClientEvents(events => events.OnEdit("onEdit"))

)



我试过这样,但没用。 。


I have tried like this,but no use..

function onEdit(e) {
 $('#Mydate').attr("disabled", true);
 $('#Mydate').attr('readonly', 'readonly');
   
                    }



两个代码都不起作用..

我的模型中有一个字符串属性字段,上面的代码用于disable.But它不适用于datetime属性字段。







感谢任何rply。


Both the codes are not working..
I have a string property field in my model,where the above code is working for disable.But it's not working for the datetime property field.



Thanks for any rply.

推荐答案

('#Mydate')。attr(disabled,true);
('#Mydate').attr("disabled", true);


('#Mydate')。attr('readonly','readonly');

}
('#Mydate').attr('readonly', 'readonly'); }



两个代码都不起作用..

我的模型中有一个字符串属性字段,上面的代码用于disable.But它不适用于datetime属性字段。







感谢任何rply。


Both the codes are not working..
I have a string property field in my model,where the above code is working for disable.But it's not working for the datetime property field.



Thanks for any rply.


这篇关于使用Jquery在Telerik Grid中禁用/ ReadOnly Datetime字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆