Hi,
how can I force the refresh of a column type "cnrt " ?
When I insert a row in a grid, I get the counter duplicate. If I perform the sorting of a column, then the counter returns correct.
thks
[code]
online var myGrid;var myGrid;
function doOnLoad(){
myGrid = new dhtmlXGridObject(‘gridbox’);
myGrid.setImagePath(“dhtmlx/codebase/imgs/dhxgrid_skyblue/”);
myGrid.setHeader(“a, Denominazione-modello-costruttore,Matricola e anno di costruzione,Campo di misura/prova in cui lo strumento è utilizzato,Cat.,Centro di taratura, ente presso il quale il centro è accreditato e numero di accreditamento (2),Frequenza di taratura”);
myGrid.setInitWidths(“20,200,200,200,50,200,200,200”);
myGrid.setColAlign(“left,left,left,left,left,left,left”);
myGrid.setColTypes(“cntr,ed,ed,ed,ed,ed,ed,ed”);
myGrid.setColSorting(" str,str,str,str,str,str,str,str");
myGrid.setColValidators(",ValidInteger");
myGrid.init();
//myGrid.load("../common/grid_16_rows_columns_manipulations.xml");
}
function add_i(){
myGrid.addRow(myGrid.uid(),[,myGrid.getRowsNum(),myGrid.getRowsNum(),myGrid.getRowsNum(),myGrid.getRowsNum(),myGrid.getRowsNum(),myGrid.getRowsNum(),myGrid.getRowsNum()],myGrid.getRowIndex(myGrid.getSelectedRowId()));
}
function add_d(){
myGrid.addRow(myGrid.uid(),[,myGrid.cells(myGrid.getSelectedRowId(), 1).getValue(),myGrid.cells(myGrid.getSelectedRowId(), 2).getValue(),myGrid.cells(myGrid.getSelectedRowId(), 3).getValue(),myGrid.cells(myGrid.getSelectedRowId(), 4).getValue(),myGrid.cells(myGrid.getSelectedRowId(), 5).getValue(),myGrid.cells(myGrid.getSelectedRowId(), 6).getValue(),myGrid.cells(myGrid.getSelectedRowId(), 7).getValue()],myGrid.getRowIndex(myGrid.getSelectedRowId()));
}
function add_r(){
myGrid.addRow(myGrid.uid(),[,myGrid.getRowsNum(),myGrid.getRowsNum(),myGrid.getRowsNum(),myGrid.getRowsNum(),myGrid.getRowsNum(),myGrid.getRowsNum(),myGrid.getRowsNum()]);
}
function delete_r() {
myGrid.deleteRow(myGrid.getSelectedRowId());}
function ser(){
myGrid.setSerializationLevel(false,false,true);
document.getElementById("alfa1").innerHTML=myGrid.serialize().replace(/\</g,"<").replace(/\>/g,">").replace(/\<row/g,"<br/><row");
}
</script>
<div id="gridbox" style="width:1200px; height:270px; background-color:white;"></div>
<a href='#alfa' onClick="if(myGrid.setSerializationLevel){ser();} else {alert('Available in Pro Edition only')}">Serialize grid</a>
<a name="alfa">
<div id="alfa1"></div>
</a>
<table width="375">
<tr>
<td>
<li><a href="#" onclick="add_i()">insert before selected row</a></li>
<li><a href="#" onclick="add_d()">Duplica la riga selezionata</a></li>
<li><a href="#" onclick="add_r()">Aggiungi una riga vuota alla lista</a></li>
<li><a href="#" onclick="delete_r()">Cancella la riga selezionata</a></li>
</td>
</tr>
</table>
[/code]