如何在DHTMLX网格中设置边框?

时间:2017-07-14 17:53:48

标签: javascript dhtmlx

我有一个DHTMLX网格,我无法弄清楚是否有行和列的边框。我检查了他们的论坛,但没有找到任何东西。我对这个网格很陌生。

这是标记

<div id="grRoyalHistory" class="col-lg-offset-2 col-md-offset-2 col-sm-offset-2 col-xs-offset-2" style="width:100%;">

</div>

这是JavaScript

function ShowRoyalHistoryGrid(data) {
    var myGrid = new dhtmlXGridObject('grRoyalHistory');
    myGrid.setHeader("RoyalHistoryID,No,RoyaltyInst,Name,Comment");
    myGrid.setInitWidthsP("5, 5, 10, 15, 65");
    myGrid.setColumnIds("RoyalHistoryID,IndexNum,RoyalIns,Name,RoyalComment");
    myGrid.setColAlign("center,center,center,left,left");
    myGrid.setColTypes("ro,ro,ro,ro,ro");
    myGrid.setColSorting("int,int,int,str,str");
    myGrid.setColumnHidden(0, true);
    myGrid.enableAutoHeight(true);
    myGrid.attachEvent("onRowSelect", function (id, ind) {
        var selectedID = myGrid.cells(myGrid.getSelectedRowId(), 0).getValue();
        GetRoyalHistoryToUpdate(selectedID);
    });
    myGrid.setSizes();
    myGrid.enableMultiline(true);
    myGrid.objBox.style.overflowX = "hidden";
    myGrid.enableAutoHeigth(true);
    myGrid.init();
    var abc = data;
    myGrid.parse(abc, "js");
}

1 个答案:

答案 0 :(得分:0)

想出来......

myGrid.setStyle("background:#e6eeee;color:black; font-weight:bold;", "border:1px solid #e6eeee;", "", "");