Check documentation for the latest version of dhtmlxSuite beforeOutput DHTMLX Docs

beforeOutput

The event occurs event occurs after data has been selected from the database and ready to be sent to client side. Event can be used to mix some custom data in XML output. The most common use-case - header structure for the grid.

$conn->event->attach("beforeOutput",handlerFunc);

Parameters handlerFunc:

  • Doesn't get any parameters

Availability:

  • Available for Grid, TreeGrid, Tree, Combo, Scheduler, DataView, Chart, Form

Sample:

function grid_header(){
    echo '<head>
    <column width="50" type="dyn" align="right" color="white" sort="str">Sales</column>
    <column width="150" type="ed" align="left" color="#d5f1ff" sort="str">Book Title</column>
    </head>';
}
$conn->event->attach("beforeOutput","grid_header");
 
//In case of dyn. loading mode, one more check need to be added, to prevent data output for additional data calls. 
function grid_header(){
        if (!isset($_GET["posStart"]))
        echo '<head>
            <column width="50" type="dyn" align="right" color="white" sort="str">Sales</column>
            <column width="150" type="ed" align="left" color="#d5f1ff" sort="str">Book Title</column>
        </head>';
}
$conn->event->attach("beforeOutput","grid_header");
$conn->dynamic_loading(100);
Back to top