jQWidgets Forums

jQuery UI Widgets Forums Grid Data Types

This topic contains 4 replies, has 2 voices, and was last updated by  mcfloyd 11 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Data Types Posts
  • Data Types #55953

    mcfloyd
    Participant

    Hello,
    If you specify a data type for a certain field (say, currency) and the field is a stringified float, will jqxGrid automatically convert this field? If not, how can I cast with the data binding function ($.jqx.dataAdapter) if I already know the types from the column sets?

    For some reason ZF2 only returns strings from the database and there isn’t a workaround that I know of…

    Thanks

    Data Types #55954

    Peter Stoev
    Keymaster

    Hi mcfloyd,

    The valid data types are: ‘number’,’ bool’, ‘date’, ‘int’, ‘float’ and ‘string’. If you want to format a number as currency, you will have to set the column’s cellsformat property to “c2”, “c”, “c3” or something like that depending on how many decimal characters you would like to have.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Data Types #55956

    mcfloyd
    Participant

    If I use the formatter, will it convert a string to another type? Or does it have to be cast as the column field’s set type before it is bound?

    Data Types #55958

    Peter Stoev
    Keymaster

    Hi mcfloyd,

    You have to set the type property of your data fields when you create the jqxDataAdapter.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Data Types #55959

    mcfloyd
    Participant

    OK thank you.

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

You must be logged in to reply to this topic.