jQWidgets Forums

jQuery UI Widgets Forums Grid jqxGrid How to set cell validator to decimal point (e.g. price)

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 10 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • Dartagnan
    Participant

    Hello, I’m trying to set cell to be price in decimal value (e.g. 5.22). However, I’m observing random weird behavior. The input is not accepted after I press enter. Once I click on sell I see the value I entered. Or sometimes value appears in wrong cell. There are no errors in console window.

    Here is my code:

    columns: [
    {text: ‘QTY’, datafield: ‘qty’, width:’8%’, columntype:’numberinput’, editable: true , createeditor: function(row,cellvalue,editor){editor.jqxNumberInput({decimalDigits:0,digits:2,min:1,max:100, spinButtons: false})}}, <—– WORKS *******
    {text: ‘Item’, datafield: ‘item’, width:’55%’, editable: false},
    {text: ‘Option’, datafield: ‘opt’, editable: false, hidden:false},
    {text: ‘Price’, datafield: ‘price’, width:’10%’, editable: true, createeditor: function(row,cellvalue,editor){editor.jqxNumberInput({decimalDigits:4,min:0,max:99, spinButtons: false})}}] <—– DOES NOT WORK *******

    Thank you


    Peter Stoev
    Keymaster

    Hi Dartagnan,

    The Cell Editing sample shows how to validate cell values and how to create validation callback function. The demo also demonstrates how to use the jqxNumberInput editor for Currency and Integer values.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.