Dojo: how to remove comma from value

后端 未结 1 385
粉色の甜心
粉色の甜心 2021-01-19 09:02

I have this Dijit number spinner:

相关标签:
1条回答
  • 2021-01-19 09:28

    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>
    
    0 讨论(0)
提交回复
热议问题