如何在Oracle Apex 18.2中访问表格形式的数据

时间:2019-02-08 05:00:01

标签: oracle oracle-apex tabular-form oracle-apex-18.2

如何在oracle apex中访问表格形式的数据。我需要基于表格形式的访问数据插入数据。请任何人帮助我解决我的问题

1 个答案:

答案 0 :(得分:0)

(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);