`
eimhee
  • 浏览: 2150598 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Inputs to DatePicker - Ext JS

阅读更多
I thought I had read that you can unobtrusively convert inputs to DatePickers by passing in the input id when creating a new DateField. I have been unable to do this successfully.

var dp = new Ext.form.DateField('myinput');
If this is correct, how do I access the date picker?
Reply With Quote
  #2  
Old 02-28-2007, 07:33 PM
Default

In addition to that, I have not been able to pass a date into the picker either. Is there a simple config option for this? I wasn't able to find one searching through the js since I am somewhat of a novice.
Reply With Quote
  #3  
Old 02-28-2007, 07:47 PM
Default

http://www.yui-ext.com/forum/viewtopic.php?t=3225

The last example listed should do what you are looking for.
Reply With Quote
  #4  
Old 02-28-2007, 07:50 PM
Default

Excellent!
Reply With Quote
  #5  
Old 02-28-2007, 08:12 PM
Default

Call me crazy but I can't get this to work and the js is producing no errors for me.

<script type='text/javascript'>
    Ext.onReady(function(){
        
        var dm_closing = new Ext.form.DateField({
                target: 'h_closing',
                value: '02/28/2007'
            });
    });
    

</script>
    
<input type=text id='h_closing' name='h_closing'>
The date picker shows up but without the value. In IE7 I get null as the value.
Reply With Quote
  #6  
Old 02-28-2007, 08:48 PM
Default

Oddly enough, I tried all the styles you referenced in that thread above and they all yield the same results. FF simply loads nothing into the datefield and IE7 loads the word 'null'. Both browsers correctly render the datepicker itself which is great. But the value doesn't seem to work in any way I try to set it.

Could this be a Rev 6 bug?
Reply With Quote
  #7  
Old 02-28-2007, 09:15 PM
Default

The default format is m/d/y. Try this:

var dm_closing = new Ext.form.DateField({
                target: 'h_closing',
                value: '02/28/2007',
                format: 'm/d/Y'
            });
You may also need to bump the width.
Reply With Quote
  #8  
Old 02-28-2007, 09:31 PM
Default

The width was not the issue, but the rather the formatting as you suggested. Its always something subtle isn't it? Anyway, thanks for the help, this works like a charm and is such as ease to use.
Reply With Quote
  #9  
Old 03-03-2007, 07:42 AM
Default

I do not understand the property 'target' (using alpa2):

<input type=text id='h_closing' name='h_closing'>
<div id='test' name='test'></div> 
<script type='text/javascript'>
        var dm_closing = new Ext.form.DateField({
                target: 'h_closing',  // seems to have no impact
                // target: 'test',  // does not work
                value: '02/28/2007',
                format: 'm/d/Y'
        });

        dm_closing.render('test');
        // dm_closing.render('h_closing); // does not work

</script>
The div 'test' is required (otherwise the datepicker gets not rendered).
Datepicker creates its on input element with its own name, regardless of the target property.

So my questions:
- what is the usage of 'target'
- how can one use the result of the datePicker in a form when using the div?

//EDIT
Seems to work in alpha2-rev6
Reply With Quote
  #10  
Old 03-03-2007, 04:22 PM
Default

Just to clarify:

If you use "target" it is to augment an existing field so calling "render()" isn't required (results unknown).

For other uses (like dynamically creating the field), render is required and 'target' will just break stuff.
Reply With Quote
分享到:
评论

相关推荐

    chinese-bert-wwm-ext.rar

    《哈工大版Chinese-BERT-wwm-ext for PyTorch深度解析》 在自然语言处理(NLP)领域,预训练模型已经成为基石,而BERT(Bidirectional Encoder Representations from Transformers)模型更是其中的明星。本文将深入...

    Laravel开发-sanatorium-inputs-lang-cs

    "Laravel开发-sanatorium-inputs-lang-cs"指的是一个特定的项目或组件,该组件是针对Laravel框架的,目的是为Cartalist平台提供捷克语(cs)的本地化支持。 1. **Laravel框架**: Laravel是由Taylor Otwell创建的...

    Python库 | switch_inputs-0.7.0-py3-none-any.whl

    标题中的"switch_inputs-0.7.0-py3-none-any.whl"是一个Python软件包,它是使用Python的打包工具创建的.whl格式文件。这种文件类型是Python的轮子(Wheel)格式,用于简化安装过程,特别是对于包含C扩展的库,它可以...

    基于torch transformers 直接加载bert预训练模型计算句子相似度

    这里我们使用了预训练模型`'chinese-bert-wwm-ext'`,它是BERT的中文版本,全名为BERT with Whole Word Masking,适用于处理中文语料。 接下来,我们需要加载预训练的BERT模型: ```python model = BertModel.from_...

    Convergence of gastric vagal and cerebellar fastigial nuclear inputs on glycemia-sensitive neurons of lateral hypothalamic area in the rat

    胃迷走和小脑顶核传入在大鼠下丘脑外侧区血糖敏感神经元上的会聚,张月萍,温云卿,下丘脑外侧区(LHA)接受多种感觉信息传入。我们和其他作者先前的研究表明,胃迷走神经和小脑顶核的传入均可到达LHA。...

    redux-inputs:redux-inputs是一个Javascript库,可与redux一起使用,以验证和存储输入和表单中的值

    redux-inputs与redux一起使用,以验证和存储输入和表单中的值。 特征 声明式验证 声明式解析 声明式格式 异步验证 按输入验证 跨领域验证 定制输入组件 程序化价值收集 程序值初始化 程序化价值修改 程序输入复位 ...

    inputs-controlled-uncontrolled-refs-userefs

    Create React App入门该项目是通过引导的。可用脚本在项目目录中,可以运行:npm start 在开发模式下运行该应用程序。 打开在浏览器中查看它。 如果您进行编辑,则页面将重新加载。 您还将在控制台中看到任何棉绒...

    inputs-vue-component

    输入项目设置npm install编译和热重装以进行开发npm run serve编译并最小化生产npm run build运行测试npm run test整理和修复文件npm run lint自定义配置请参阅。

    Struct-Inputs-Using-Ethersjs-and-Truffle:有关如何使用新的experimentalABIEncoderV2设置Truffle和Ethers.js的快速示例

    有关如何使用新的experimentalABIEncoderV2设置Truffle和Ethers.js的快速示例 运行yarn install 。 在另一个终端中运行testrpc 。 运行truffle test以运行测试以测试Javascript测试中的结构输入。

    LM324运算放大器

    - 引脚2:输入1(Inputs1) - 引脚3:输入1(Inputs1) - 引脚4:输出2(Out2) - 引脚5:输入2(Inputs2) - 引脚6:输入2(Inputs2) - 引脚7:正电源(VCC) - 引脚8:输出3(Out3) - 引脚9:输入3(Inputs3) -...

    PyPI 官网下载 | tf-inputs-0.2.2.tar.gz

    标题中的"PyPI 官网下载 | tf-inputs-0.2.2.tar.gz"表明这是一个在Python Package Index (PyPI) 上发布的软件包,名为`tf-inputs`,版本为0.2.2,其分发形式是压缩文件`.tar.gz`。PyPI是Python开发者发布自己编写...

    batch-image-transform:批量应用图像过滤器

    js -- in / path / to / inputs / -- out / path / to / outputs / 色调模糊 代码见 node index . js -- filter hueblur -- radius 3 -- in / path / to / inputs / -- out / path / to / outputs - blur - 3 / ...

    QS-inputs-split

    inputs的拆分版相较于QS-inputs优点: 可拓展性强、兼容性强(尽量兼容全端)缺点: 不能根据后台自动生成对应的类型(动态性不如QS-inputs)展望: 在QS-inputs-split的基础上再进行合并更新说明版本说明v1.2修复picker的...

    ember-cli-masked-inputs:一组 ember 组件,每个组件都提供一致的蒙版外观和感觉,以实现出色的用户体验

    ember-cli-masked-inputs 描述 Ember-cli-masked-inputs 是一组 ember 组件,每个组件都提供一致的屏蔽外观和感觉,以实现出色的用户体验 安装 # install via npm $ npm install ember-cli-masked-inputs --save-...

    SEW MOVIDRIVE B培训练习

    MOVIDRIVE B培训练习 MOVITOOLS进行电机初始化 当货物传送时,电机的加减速时间都需要做调整 1) 斜坡时间是参考于什么的? 2 )设置斜坡时间t11 up和t... Binary inputs----开关量输入点 Sampling time采样时间: 10ms

    Analog-Inputs-For-ESP8266:带有 4 个 I2C AD 转换器的分线板。 对于缺少模拟输入的微控制器

    MCP3021 阵列分线板用于四 (4) 个 I2C 10 位模数 (A/D) 转换器的分线板。去哪买它是什么? 带有四个模数 (A/D) 转换器的电路板,您的 ESP8266 可以使用 I2C 与其连接。你为什么成功? ESP8266 是一个很棒的模块,但...

    T123AI_Datasheet_V1.02

    - Integrates 10-bit Triple Analog to Digital Converters (ADC) & Phase Locked Loop (PLL) - Scaler supports 2-D adaptive intra-field deinterlacer and non-linear 16:9 aspect ration. - Requires no ...

    PyPI 官网下载 | textual-inputs-0.2.4.tar.gz

    文本输入库 `textual-inputs` 是一个针对Python开发的工具,主要目的是为了方便开发者在命令行或文本界面应用中创建交互式用户输入。这个库的版本为0.2.4,可以从Python的官方包索引(PyPI)网站上下载。`tar.gz` ...

Global site tag (gtag.js) - Google Analytics