Implementing New Types of Statistics Counters

Hi.

Iā€™m trying to attach statistics to an external object, but the doc example is not very clear and javascript shows errors :slight_smile:

Without alert(ffr); I get error in filter file, line 45, t is undefined

 this.attachEvent("onEditCell",function(stage,id,ind){if (stage==2 && ( ind==i || ( i && i[ind])) ) f.call(this);return true;})]);t.innerHTML="";}; 

And in custom function, without c = ā€œā€; I get c is undefined error.

Any insight or advice on this?

Greetings and thanks.

        <!-- dhtmlxGrid -->
        <script src="codebase/dhtmlxgrid.js"></script>
        <script src="codebase/dhtmlxgridcell.js"></script>
        <script src="codebase/dhtmlxgrid_filter.js"></script>

            function makeBookingWindow(event_id) {
                if ( dhxWins.isWindow('choice') ) {
                    dhxWins.window('choice').close();
                }
                if ( dhxWins.isWindow('cust_grid') ) {
                    dhxWins.window('cust_grid').close();
                }
                if (!(event_id)) {
                    var ev =  scheduler.getEvent(last_id);
                    ev.prop = 'broneering';
                }
                var w_book = dhxWins.createWindow("booking", 0, 0, 1024, 768);
                w_book.setText("Broneerimine"); 
                dhxWins.window('booking').centerOnScreen();
                booklay = new dhtmlXLayoutObject(w_book, "3E");
                booklay.cells("a").hideHeader();
                booklay.cells("b").hideHeader();
                booklay.cells("c").hideHeader();
                booklay.cells("b").setHeight(150);
                booklay.cells("a").attachURL('bron_client_info.php?customer_id='+customer_id);
                ChosenGrid = booklay.cells("b").attachGrid();
                pstatus = booklay.cells("c").attachURL('payment_status.html');
                ChosenGrid.setImagePath("codebase/imgs/")
                ChosenGrid.setHeader("ID,Algus,Kestus,Tooted/Teenused,Hind,KM,Kogus,Allah,Kokku");
                ChosenGrid.setInitWidths("50,*");

                ChosenGrid._in_header_stat_count=function(tag,index,c){  //shortcut for statistics counter
                    var calck=function(){                          // define the function which will be used for calculations
                        return this.getRowsNum();
                    }
                    c = "";
                    this._stat_in_header(tag,calck,index,c);       //call the default statistics handler processor
                }

                 ChosenGrid.init();

                var ffr = booklay.cells("c").getFrame();
                //alert(ffr);
                ChosenGrid._in_header_stat_count(ffr.contentWindow.document.getElementById('grid_count'),1);

            }

Be sure, that on moment of next call

 ChosenGrid._in_header_stat_count(ffr.contentWindow.document.getElementById('grid_count'),1);

next element is really exists

ffr.contentWindow.document.getElementById('grid_count')