How to access tabular form data in oracle apex 18.2

601 Views Asked by At

How to access tabular form data in oracle apex.I need to insert data based on access data in tabular form. please any one help me to solve my problem

1

There are 1 best solutions below

2
arman On
(function($) {

    function update(model) {
        var salKey = model.getFieldKey("SAL"), 
            total = 0;

        model.forEach(function(record, index, id) {
            var sal = parseInt(record[salKey], 10),  
                meta = model.getRecordMetadata(id);

            if (!isNaN(sal) && !meta.deleted && !meta.agg) {
                total += sal;
            }
        });
        $s("P1_TOTAL_AMOUNT", total);
    }

    $(function() {

        $("#emp").on("interactivegridviewmodelcreate", function(event, ui) {
            var sid,
                model = ui.model;

            if ( ui.viewId === "grid" ) {
                sid = model.subscribe( {
                    onChange: function(type, change) {
                        if ( type === "set" ) {

                            if (change.field === "SAL" ) {
                                update( model );
                            }
                        } else if (type !== "move" && type !== "metaChange") {

                            update( model );
                        }
                    },
                    progressView: $("#P1_TOTAL_AMOUNT") 
                } );

                update( model ); 

                model.fetchAll(function() {});
            }
        });
    });
})(apex.jQuery);