Hello,
Here is a grid, the purpose is to create proposal and invoice.
-
When I click on the button “Ajouter” (Add), I would like the cursor is directly in the first cell of the next row and the cell is in edit mode.
I try this :
devisGrid = devisLayout.cells(“c”).attachGrid();
devisGrid.setHeader(“Référence,Désignation,Qté,Unité,Px Unitaire,Px Total”);
devisGrid.setColumnIds(“reference,designation,quantite,unite,prix_unit,prix_total”);
devisGrid.setInitWidths(“80,389,60,64,82,82”);
devisGrid.setColAlign(“left,left,right,right,right,right”);
devisGrid.setColTypes(“ed,txttxt,edn,ed,edn,ron[=c2*c4]”);
devisGrid.setNumberFormat(“000.00 €”,4);
devisGrid.setNumberFormat(“0,000.00 €”,5,“.”,“,”);
devisGrid.enableAutoWidth();
devisGrid.attachFooter(“Total,#cspan,#cspan,#cspan,#cspan,#stat_total”);
devisGrid.enableEditEvents(true,false,true);
devisGrid.init();devisGrid.callEvent(“onGridReconstructed”,[]);
devisToolBar.attachEvent(“onclick”,function(id){
if(id==“add”)
{
var rowId = devisGrid.uid(); // ----- generates an unique id
devisGrid.addRow(rowId, [“”,“Nouvelle ligne”,“”,1,“”], devisGrid.getRowsNum());
//devisGrid.selectRowById(rowId);
devisGrid.selectCell(rowId, 0, true, true, true);
devisGrid.editCell();
devisGrid.selectRowById(rowId);
};
}); -
I need to add a new row to have the total, in the footer, calculated. How can I make this automatic ?
Thanks for your help
Best regards