Extjs + jQuery一起 [英] Extjs + jQuery together

查看:89
本文介绍了Extjs + jQuery一起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Ext.onReady函数和jQuery一起使用?

How to use Ext.onReady function and jQuery together ?

我已经使用ext js来生成树,并且我想使用jQuery来验证某些文本字段值.

I have used ext js for generating tree and I want to use jQuery for validation of some textfield values.

或使用extjs验证文本字段的任何其他方法?

Or any other way to validate textfield using extjs?

推荐答案

Ext通过文本字段配置对某些事物(例如,allowBlank: false)具有内置的验证,而对于其他事物则具有验证器功能(对于所有VTypes函数),并且还提供了用于提供自定义验证的钩子.不知道为什么您只需要为此添加jQuery,也许您可​​以更具体些?

Ext has built-in validation via textfield configs for some things (e.g. allowBlank: false) and validator functions for others (all of the VTypes functions), and also hooks for providing custom validation. Not sure why you'd need to add jQuery just for that, maybe you can be more specific?

但是假设您确实需要同时使用这两个库,则应该能够使用Ext或jQuery的DOM ready函数作为您的入口点(而不是两者),然后假设两个库都正确,则可以在其中编写所需的任何代码引用并初始化.假设每个库的DOM ready函数均按声明的方式工作,则在调用任一库时DOM应该可用,这是始终使用这些方法的唯一目的.既然您使用的是Ext窗口小部件,为了安全起见,我可能会坚持使用Ext.onReady,但是从理论上讲,使用哪个函数实际上并不重要.

But assuming you really do need to use both, you should be able to use either Ext's or jQuery's DOM ready function as your entry point (not both), and then write whatever code you need inside of it assuming both libraries are properly referenced and initialized. Assuming that each library's DOM ready function works as advertised, the DOM should be available when either one is called, which is the only point of using those methods anyway. Since you are using Ext widgets I would probably stick with Ext.onReady just to be on the safe side, but in theory it really shouldn't matter which function you use.

这篇关于Extjs + jQuery一起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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