Hi, im using a dhtmlxGrid and i cannot realize how to “show” new rows, and i mean “show”, because if you browse the DOM you’ll find that they are really there.
Here is the code im using:
[code]
<script type="text/javascript" language="javascript">
var dhxGrid;
function onReady() {
dhxGrid = new dhtmlXGridObject("divGrid");
dhxGrid.setSkin("dhx_skyblue");
dhxGrid.setHeader(["Name","Size","Type","Description"]);
dhxGrid.setInitWidths("200,100,100,*");
dhxGrid.setColAlign("left,right,left,left");
dhxGrid.setColTypes("ro,ro,ro,ro");
dhxGrid.setColSorting("str,int,str,str");
dhxGrid.init();
loadData();
}//onReady
function loadData() {
dhxGrid.clearAll();
dhxGrid.addRow(1,["a1",1,"c1","d1"]);
dhxGrid.addRow(2,["a2",2,"c2","d2"]);
dhxGrid.addRow(3,["a3",3,"c3","d3"]);
dhxGrid.addRow(4,["a4",4,"c4","d4"]);
dhxGrid.addRow(5,["a5",5,"c5","d5"]);
dhxGrid.addRow(6,["a6",6,"c6","d6"]);
dhxGrid.addRow(7,["a7",7,"c7","d7"]);
dhxGrid.addRow(8,["a8",8,"c8","d8"]);
alert(dhxGrid.getRowsNum());
}
</script>
[/code]
Things i’ve tested:
- there are rows because an alert with dhxGrid.getRowsNum() shows “8”.
- add rows starting from index 0 instead of 1.
- using a string for the unique id instead of a integer.
- using string format (“a1, 1, b1, c1”) for the 2nd parameter instead of an Array.
- using the 3rd parameter refering the previous item.
- use of setRowHidden(…,false) after each addRow with its unique id.
- remove the clearAll() before adding rows.
- removing allmost everything except for the requeired actions (object creation, headers, init)
- converted every column to “str”