<%@language = "javascript" %>

<!-- #include file="../scf/scaffolding.inc" -->
<!-- #include file="../mgt/mgt_tools.inc" -->
<!-- #include file="../api2/model_fac_widget.inc" -->

<%
var  this_model = new model_fac_widget();

this_model.hook_pre_search = function (fld)
{
    // Voor de search vervangen we het tekestveld fac_widget_groep voor een LOV.
    var groupLOV = "";
    var sql = "SELECT DISTINCT fac_widget_groep"
            + "  FROM fac_widget"
            + " ORDER BY fac_widget_groep";
    var oRs = Oracle.Execute(sql);
    while (!oRs.eof)
    {
        var groep = oRs("fac_widget_groep").Value;
        groupLOV += (groupLOV?";":"") + groep + ";" + groep;
        oRs.moveNext();
    }
    oRs.Close();
    fld.group.LOV = groupLOV;
}

scaffolding(this_model,
    {
        "search": {
            "autosearch": true,
            "filters" : [
                "group",
                "name"
            ]
        },
        "list": {
            "columns": [
                "group",
                "sequence",
                "name",
                "link_url",
                "widget_heigth",
                "widget_width",
                "refreshtime",
                "created"
            ],
            "orderby": [
                "group",
                "sequence",
                "name"
            ]
        }
    });
%>
