Forum Stats

  • 3,814,524 Users
  • 2,258,880 Discussions
  • 7,892,765 Comments

Discussions

Autonumeric for interactive grids

Jake4321
Jake4321 Member Posts: 221 Blue Ribbon
edited Oct 3, 2019 8:22AM in APEX Discussions

Hi all,

I am currently working with Application Express 19.1.0.00.15.

I was able to implement the autonumeric "plugin"  and successfully use it with standard items on a page/form.

https://github.com/topics/autonumeric

I am currently searching on how to use it with Interactive Grids but I was not successfull in doing so. i

The methods on the plugin allow to address either a class or a specific DOM item. For standard page items , I am using the class 'number_field' and it works fine.

With Interactive grids, I tried using the class 'a-GV-cell u-tS' but that did not work. I also tried with a static id but this did not work either. i.e. nothing happens.

Has anyone experimented with this "plugin" and specifically with Interactive grids.

Any information, tips, suggestions is greatly appreciated as usual.

Thanks,

Jake

-- modified by Jake 20190923

here is the code am im using:

This is a javascript fired on page load dynamic action:

-- This is the code to initialise all number_field class items.

new AutoNumeric('.number_field', {

    aSep:',',

    decimalCharacter:'.',

    aSign: '$',

    pSign: 's'

});

-- This is the code I am using to initialize a specific column in the datagrid.

new AutoNumeric.multiple('.CoutAvTaxes_HDR', {

    aSep:',',

    decimalCharacter:'.',

    aSign: '$',

    pSign: 's'

});

APEX adds the _HDR suffic to the column static id.

Any tips, suggestions are greatly appreciated.

Thanks,

Jake

This message was modified by : Jake4321

Tagged:

Best Answer

  • Jake4321
    Jake4321 Member Posts: 221 Blue Ribbon
    edited Oct 3, 2019 8:22AM Answer ✓

    Hi all,

    just sharing some more information on using autoNumeric with datagrids.

    AutoNumeric is not "line/row aware" so using it with datagrids does not work properly even with staticids.

    When moving through the datagrid column-wise, the amount entered on the first line/row is automatically replicated to the rows below which is defenetely not a behavior that we want.

    Regards,

    Jake

Answers

  • Jake4321
    Jake4321 Member Posts: 221 Blue Ribbon
    edited Sep 23, 2019 8:43AM

    Hi all,

    I found the issue. I was using the syntax for the column.

    The correct syntax is as follow:

    -- to initialise all standard items on a page with class "number_field"

    new AutoNumeric('.number_field', {

        aSep:',',

        decimalCharacter:'.',

        aSign: '$',

        pSign: 's'

    });

    -- to initialise specific columns in an interactive grid through a static id.

    new AutoNumeric.multiple('#YourStaticId', {

        aSep:',',

        decimalCharacter:'.',

        aSign: '$',

        pSign: 's'

    });

    This works fine for me now.

    Thanks,

    Jake

  • Jake4321
    Jake4321 Member Posts: 221 Blue Ribbon
    edited Oct 3, 2019 8:22AM Answer ✓

    Hi all,

    just sharing some more information on using autoNumeric with datagrids.

    AutoNumeric is not "line/row aware" so using it with datagrids does not work properly even with staticids.

    When moving through the datagrid column-wise, the amount entered on the first line/row is automatically replicated to the rows below which is defenetely not a behavior that we want.

    Regards,

    Jake