I’m trying to insert a really simple grid with a database connection in a Layout. The code is:
myGrid = myLayout.cells("a").attachGrid({});
myGrid.setImagePath("dhtmlx/codebase/imgs/")
myGrid.setHeader("Tipo, Termine, N°, Cliente, Polizza, Importo");
myGrid.setColTypes("ro,ron,ron,rotxt,rotxt,ron");
myGrid.setColSorting("connector,connector,connector,connector,connector,connector")
myGrid.setNumberFormat("0,000.00",5,".","'");
myGrid.setDateFormat("%d/%m/%Y", "%Y-%m-%d"); // 05/26/2010, 2010/05/26
myGrid.setColAlign("left,left,left,left,center,right")
myGrid.init();
myGrid.load("01a_sql_basic_connector.php");
myGrid.enableAutoWidth(true);
myGrid.enableAlterCss("even","uneven");
myGrid.setStyle("font-size:12px; text-align:center; color: #666;", "font-size:11px;","", "");
myGrid.setColWidth(0,"8");
myGrid.setColWidth(1,"64");
myGrid.setColWidth(2,"40");
myGrid.setColWidth(3,"120");
myGrid.setColWidth(4,"94");
myGrid.setColWidth(5,"58");
myGrid.forEachRow(function(id){
myGrid.setCellTextStyle(id,2,"font-weight:bold;")
});
I noticed some problem with this cose:
- the last part of the code that should change the font-weight of the second row to bold worked with the xml file, now with the connection it’s not working.
- it’s possible to change the margins on the table?
- even some advice on the code would be welcome
Thank you in advance