Join the Team Forms community

K
Katia
Offline, last seen 2 days ago
Joined September 10, 2024

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 !

11 comments
K
E
K
Katia

Hi,

How can I display the name of the location chosen in the Address component? Only the address is displayed.

In this example : I would like to display "Cimetières d'Ixelles" + address


Thank you in advance.



K
Katia
Under consideration

Add a datatable component

Hi everybody,

It would be nice to use a data table component with options like filterable, sortable, submit selected rows, actions buttons,...

And it would be nice to be able to connect it with a datasource.

An example:


Is it possible ?

Thank you.

Hi everybody,

I would like to limit the address component to 2 or 3 cities in Belgium.

Is it possible?

Thank you in advance.

Katia

1 comment
E