Dojo: how to remove comma from value

孤街醉人 提交于 2019-12-01 18:34:09

The simple answer is to add pattern:'#' to your constraints object.

The pattern property allows you to specify how you want your numeric data to be displayed. Here is a link to dojo's reference on number patterns. The whole page is pretty informative on formatting numbers.

Your example should end up looking something like this:

<div class="extra_field hide_on_load form_action_fy">
    <label>Action Fiscal Year</label>
    <input name="form_action_fy" id="form_action_fy"
        data-dojo-type="dijit.form.NumberSpinner" 
        data-dojo-props="
            value:2011,
            smallDelta:1, 
            largeDelta:1, 
            constraints:{min:2010,max:2020,places:0,pattern:'#'}"
    />
</div>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!