Hi everybody,
I would like to display all items from a sharepoint data inside a datagrid component. It works well.
But I want to edit the 'test' component inside the datagrid.
In this example, the first column comes from the sharepoint data source. when I want to write something in the second column, it doesnāt work. It's impossible to write something. It bugs...
I use this code (logic inside the datagrid component)Ā and the Redraw On is on 'any change'
Ā Plain Text
Ā // Create a function
async function updateDataGrid(){
// Get all items from the data-source using its id (replace 'yourDataSourceId' with your actual data source id)
var items = await tf.getDataSource('xxxxxxxxxxxx');
// Apply a filter based on data in the form (adjust the filter condition as needed)
var filteredItems = items.filter(i => i?.competence === 'BĆ¢timent');
// Use a "Map" to rename the columns from the data source to match the names of field names used in the data-grid
var gridItems = filteredItems.map(i => {
return {
requisitionNumber: i?.id,
items: i?.type_intervention,
preuvePhoto: i?.photo,
echeance : i?.echeance,
batiment : i?.batiment,
etage : i?.etage,
emplacement : i?.emplacement,
tache : i?.tache,
urgence : i?.urgence,
test : ''
};
});
// Set the value of the data-grid component programmatically
instance.root.getComponent('i_batiment').setValue(gridItems);
}
// Invoke the function
updateDataGrid();
Ā
Thanks in advance !