[Data Grid Web] - force selection of all rows with javascript

Hi Guys,


We would like to force the selection of the grid like in the image, so that we can save it, but forcing it by a button and not the checkbox.



We tried with javascript, it selects but nothing happens, i guess it needs the event of the check all rows.  We tried like this:


Is there a way to check all rows and force the event of selection? one function of the grid that i should use?

The idea is, when we close the pop-up that has the grid, we want to select all rows and save it. The part of the save we click in another button with javascript so that it can send the action 

GridOS.SelectionFeature.sendJsonSelectedElements(....)

Can anyone help me?

Thanks.

Hi @João Leitão ,


I was able to do it. It could not be the best way, but i wasn't able to trigger the function that do this piece of code:

So I copy this to my function and it select all rows.

This was copy from GridFramework JS, function GridOS.GridColumnFeature.columnSelectRow.

I attach the sample.

Regards,

Luis

DataGridSampleCaseTest.oml

Hi @Luis Filipe Oliveira, sorry for the delay. Thanks so much, it worked perfectly!


Regards,

Joao


Hi @João Leitão , do you have a sample OML? To do some tests quicker.

Hi @Luis Filipe Oliveira, here it goes a sample. I used the Grid sample to add the button to test. In this case the button "> Click me <" it is what was added to test. The thing we are trying to do is, when clicking, it selects all rows, and then does a click in the "Send Selected" and saves the data. But when it does the click on the "Send selected" nothing happens. It seems it does not click on the button, or the data that is selected by the javascript does not recognize.

Thanks in advance

 

DataGridSampleCaseTest.oml

Hi Joao, I tried it yesterday. It selects but for the component is not selected. It’s missing some action from the component, because the row isn’t highlighted. If no ones replied wit the answered I will try to see it next week.

thanks @Luis Filipe Oliveira :) 

I will see if i can put to use what @Ajit Kurane said. Just can try tomorrow because i don't have access to the environment today.

Hello Friend,

can you please try it by taking reference of below link,

https://stackoverflow.com/questions/44740761/select-all-rows-programmatically-and-keep-selection

Kind Regards,

Ajit kurane.

Hi @Ajit Kurane , i will try that if it works and let you know. 

thanks :)

Hi Guys, 

@Ajit Kurane  just to say that the link about the selection is from other grid: https://stackoverflow.com/questions/44740761/select-all-rows-programmatically-and-keep-selection

the component of the datagrid that is available in outsystems is based on the wijmo flex grid, i think.

Unfortunately i'm still with the same problem of the selection

Hi @João Leitão ,


I was able to do it. It could not be the best way, but i wasn't able to trigger the function that do this piece of code:

So I copy this to my function and it select all rows.

This was copy from GridFramework JS, function GridOS.GridColumnFeature.columnSelectRow.

I attach the sample.

Regards,

Luis

DataGridSampleCaseTest.oml

Hi @Luis Filipe Oliveira, sorry for the delay. Thanks so much, it worked perfectly!


Regards,

Joao


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.